aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2008-05-08 14:46:34 +0000
committerStefan Monnier2008-05-08 14:46:34 +0000
commitefcb74f6270716aec2fa769a01369b8787b49587 (patch)
treeaa49914080e89f70b802ff5eaf7f59e9c6ab0d87
parent4fedcc004bb01336e15f2f1610e919bf9023f09e (diff)
downloademacs-efcb74f6270716aec2fa769a01369b8787b49587.tar.gz
emacs-efcb74f6270716aec2fa769a01369b8787b49587.zip
Fix up commenting convention.
-rw-r--r--lisp/dired-x.el169
1 files changed, 83 insertions, 86 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 2e449b703ac..a23b90118b7 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -331,7 +331,7 @@ to nil: a pipe using `zcat' or `gunzip -c' will be used."
331 (define-key global-map "\C-x4\C-j" 'dired-jump-other-window))) 331 (define-key global-map "\C-x4\C-j" 'dired-jump-other-window)))
332 332
333 333
334;;; Install into appropriate hooks. 334;; Install into appropriate hooks.
335 335
336(add-hook 'dired-mode-hook 'dired-extra-startup) 336(add-hook 'dired-mode-hook 'dired-extra-startup)
337(add-hook 'dired-after-readin-hook 'dired-omit-expunge) 337(add-hook 'dired-after-readin-hook 'dired-omit-expunge)
@@ -420,7 +420,7 @@ Remove expanded subdir of deleted dir, if any."
420 420
421;;; EXTENSION MARKING FUNCTIONS. 421;;; EXTENSION MARKING FUNCTIONS.
422 422
423;;; Mark files with some extension. 423;; Mark files with some extension.
424(defun dired-mark-extension (extension &optional marker-char) 424(defun dired-mark-extension (extension &optional marker-char)
425 "Mark all files with a certain EXTENSION for use in later commands. 425 "Mark all files with a certain EXTENSION for use in later commands.
426A `.' is *not* automatically prepended to the string entered." 426A `.' is *not* automatically prepended to the string entered."
@@ -442,7 +442,7 @@ A `.' is *not* automatically prepended to the string entered."
442 (interactive "sFlagging extension: ") 442 (interactive "sFlagging extension: ")
443 (dired-mark-extension extension dired-del-marker)) 443 (dired-mark-extension extension dired-del-marker))
444 444
445;;; Define some unpopular file extensions. Used for cleaning and omitting. 445;; Define some unpopular file extensions. Used for cleaning and omitting.
446 446
447(defvar dired-patch-unclean-extensions 447(defvar dired-patch-unclean-extensions
448 '(".rej" ".orig") 448 '(".rej" ".orig")
@@ -537,8 +537,8 @@ buffer and try again."
537 537
538;;; OMITTING. 538;;; OMITTING.
539 539
540;;; Enhanced omitting of lines from directory listings. 540;; Enhanced omitting of lines from directory listings.
541;;; Marked files are never omitted. 541;; Marked files are never omitted.
542 542
543;; should probably get rid of this and always use 'no-dir. 543;; should probably get rid of this and always use 'no-dir.
544;; sk 28-Aug-1991 09:37 544;; sk 28-Aug-1991 09:37
@@ -650,13 +650,13 @@ Optional fourth argument LOCALP is as in `dired-get-filename'."
650;; Compiler does not get fset. 650;; Compiler does not get fset.
651(declare-function dired-omit-old-add-entry "dired-x") 651(declare-function dired-omit-old-add-entry "dired-x")
652 652
653;;; REDEFINE. 653;; REDEFINE.
654;;; Redefine dired-aux.el's version of `dired-add-entry' 654;; Redefine dired-aux.el's version of `dired-add-entry'
655;;; Save old defun if not already done: 655;; Save old defun if not already done:
656(or (fboundp 'dired-omit-old-add-entry) 656(or (fboundp 'dired-omit-old-add-entry)
657 (fset 'dired-omit-old-add-entry (symbol-function 'dired-add-entry))) 657 (fset 'dired-omit-old-add-entry (symbol-function 'dired-add-entry)))
658 658
659;;; REDEFINE. 659;; REDEFINE.
660(defun dired-omit-new-add-entry (filename &optional marker-char relative) 660(defun dired-omit-new-add-entry (filename &optional marker-char relative)
661 ;; This redefines dired-aux.el's dired-add-entry to avoid calling ls for 661 ;; This redefines dired-aux.el's dired-add-entry to avoid calling ls for
662 ;; files that are going to be omitted anyway. 662 ;; files that are going to be omitted anyway.
@@ -689,7 +689,7 @@ Optional fourth argument LOCALP is as in `dired-get-filename'."
689 689
690;;; VIRTUAL DIRED MODE. 690;;; VIRTUAL DIRED MODE.
691 691
692;;; For browsing `ls -lR' listings in a dired-like fashion. 692;; For browsing `ls -lR' listings in a dired-like fashion.
693 693
694(defalias 'virtual-dired 'dired-virtual) 694(defalias 'virtual-dired 'dired-virtual)
695(defun dired-virtual (dirname &optional switches) 695(defun dired-virtual (dirname &optional switches)
@@ -811,14 +811,14 @@ Also useful for `auto-mode-alist' like this:
811 811
812;;; SMART SHELL. 812;;; SMART SHELL.
813 813
814;;; An Emacs buffer can have but one working directory, stored in the 814;; An Emacs buffer can have but one working directory, stored in the
815;;; buffer-local variable `default-directory'. A Dired buffer may have 815;; buffer-local variable `default-directory'. A Dired buffer may have
816;;; several subdirectories inserted, but still has but one working directory: 816;; several subdirectories inserted, but still has but one working directory:
817;;; that of the top level Dired directory in that buffer. For some commands 817;; that of the top level Dired directory in that buffer. For some commands
818;;; it is appropriate that they use the current Dired directory instead of 818;; it is appropriate that they use the current Dired directory instead of
819;;; `default-directory', e.g., `find-file' and `compile'. This is a general 819;; `default-directory', e.g., `find-file' and `compile'. This is a general
820;;; mechanism is provided for special handling of the working directory in 820;; mechanism is provided for special handling of the working directory in
821;;; special major modes. 821;; special major modes.
822 822
823;; It's easier to add to this alist than redefine function 823;; It's easier to add to this alist than redefine function
824;; default-directory while keeping the old information. 824;; default-directory while keeping the old information.
@@ -856,22 +856,22 @@ Knows about the special cases in variable `default-directory-alist'."
856 856
857;;; LOCAL VARIABLES FOR DIRED BUFFERS. 857;;; LOCAL VARIABLES FOR DIRED BUFFERS.
858 858
859;;; Brief Description: 859;; Brief Description:
860;;; 860;;;
861;;; * `dired-extra-startup' is part of the `dired-mode-hook'. 861;; * `dired-extra-startup' is part of the `dired-mode-hook'.
862;;; 862;;;
863;;; * `dired-extra-startup' calls `dired-hack-local-variables' 863;; * `dired-extra-startup' calls `dired-hack-local-variables'
864;;; 864;;;
865;;; * `dired-hack-local-variables' checks the value of 865;; * `dired-hack-local-variables' checks the value of
866;;; `dired-local-variables-file' 866;;; `dired-local-variables-file'
867;;; 867;;;
868;;; * Check if `dired-local-variables-file' is a non-nil string and is a 868;; * Check if `dired-local-variables-file' is a non-nil string and is a
869;;; filename found in the directory of the Dired Buffer being created. 869;;; filename found in the directory of the Dired Buffer being created.
870;;; 870;;;
871;;; * If `dired-local-variables-file' satisfies the above, then temporarily 871;; * If `dired-local-variables-file' satisfies the above, then temporarily
872;;; include it in the Dired Buffer at the bottom. 872;;; include it in the Dired Buffer at the bottom.
873;;; 873;;;
874;;; * Set `enable-local-variables' temporarily to the user variable 874;; * Set `enable-local-variables' temporarily to the user variable
875;;; `dired-enable-local-variables' and run `hack-local-variables' on the 875;;; `dired-enable-local-variables' and run `hack-local-variables' on the
876;;; Dired Buffer. 876;;; Dired Buffer.
877 877
@@ -914,8 +914,7 @@ dired."
914 (message "File `./%s' already exists." dired-local-variables-file) 914 (message "File `./%s' already exists." dired-local-variables-file)
915 915
916 ;; Create `dired-local-variables-file'. 916 ;; Create `dired-local-variables-file'.
917 (save-excursion 917 (with-current-buffer (get-buffer-create " *dot-dired*")
918 (set-buffer (get-buffer-create " *dot-dired*"))
919 (erase-buffer) 918 (erase-buffer)
920 (insert "Local Variables:\ndired-omit-mode: t\nEnd:\n") 919 (insert "Local Variables:\ndired-omit-mode: t\nEnd:\n")
921 (write-file dired-local-variables-file) 920 (write-file dired-local-variables-file)
@@ -928,37 +927,37 @@ dired."
928 927
929;;; GUESS SHELL COMMAND. 928;;; GUESS SHELL COMMAND.
930 929
931;;; Brief Description: 930;; Brief Description:
932;;; 931;;;
933;;; `dired-do-shell-command' is bound to `!' by dired.el. 932;; `dired-do-shell-command' is bound to `!' by dired.el.
934;;; 933;;;
935;;; * Redefine `dired-read-shell-command' so it calls 934;; * Redefine `dired-read-shell-command' so it calls
936;;; `dired-guess-shell-command'. 935;;; `dired-guess-shell-command'.
937;;; 936;;;
938;;; * `dired-guess-shell-command' calls `dired-guess-default' with list of 937;; * `dired-guess-shell-command' calls `dired-guess-default' with list of
939;;; marked files. 938;;; marked files.
940;;; 939;;;
941;;; * Parse `dired-guess-shell-alist-user' and 940;; * Parse `dired-guess-shell-alist-user' and
942;;; `dired-guess-shell-alist-default' (in that order) for the first REGEXP 941;;; `dired-guess-shell-alist-default' (in that order) for the first REGEXP
943;;; that matches the first file in the file list. 942;;; that matches the first file in the file list.
944;;; 943;;;
945;;; * If the REGEXP matches all the entries of the file list then evaluate 944;; * If the REGEXP matches all the entries of the file list then evaluate
946;;; COMMAND, which is either a string or a Lisp expression returning a 945;;; COMMAND, which is either a string or a Lisp expression returning a
947;;; string. COMMAND may be a list of commands. 946;;; string. COMMAND may be a list of commands.
948;;; 947;;;
949;;; * Return this command to `dired-guess-shell-command' which prompts user 948;; * Return this command to `dired-guess-shell-command' which prompts user
950;;; with it. The list of commands is put into the list of default values. 949;;; with it. The list of commands is put into the list of default values.
951;;; If a command is used successfully then it is stored permanently in 950;;; If a command is used successfully then it is stored permanently in
952;;; `dired-shell-command-history'. 951;;; `dired-shell-command-history'.
953 952
954;;; Guess what shell command to apply to a file. 953;; Guess what shell command to apply to a file.
955(defvar dired-shell-command-history nil 954(defvar dired-shell-command-history nil
956 "History list for commands that read dired-shell commands.") 955 "History list for commands that read dired-shell commands.")
957 956
958;;; Default list of shell commands. 957;; Default list of shell commands.
959 958
960;;; NOTE: Use `gunzip -c' instead of `zcat' on `.gz' files. Some do not 959;; NOTE: Use `gunzip -c' instead of `zcat' on `.gz' files. Some do not
961;;; install GNU zip's version of zcat. 960;; install GNU zip's version of zcat.
962 961
963(defvar dired-guess-shell-alist-default 962(defvar dired-guess-shell-alist-default
964 (list 963 (list
@@ -1203,8 +1202,8 @@ See `dired-guess-shell-alist-user'."
1203 ;; If we got a return, then return default. 1202 ;; If we got a return, then return default.
1204 (if (equal val "") default val)))) 1203 (if (equal val "") default val))))
1205 1204
1206;;; REDEFINE. 1205;; REDEFINE.
1207;;; Redefine dired-aux.el's version: 1206;; Redefine dired-aux.el's version:
1208(defun dired-read-shell-command (prompt arg files) 1207(defun dired-read-shell-command (prompt arg files)
1209 "Read a dired shell command prompting with PROMPT (using read-string). 1208 "Read a dired shell command prompting with PROMPT (using read-string).
1210ARG is the prefix arg and may be used to indicate in the prompt which 1209ARG is the prefix arg and may be used to indicate in the prompt which
@@ -1305,27 +1304,27 @@ for more info."
1305 1304
1306;;; VISIT ALL MARKED FILES SIMULTANEOUSLY. 1305;;; VISIT ALL MARKED FILES SIMULTANEOUSLY.
1307 1306
1308;;; Brief Description: 1307;; Brief Description:
1309;;; 1308;;;
1310;;; `dired-do-find-marked-files' is bound to `F' by dired-x.el. 1309;; `dired-do-find-marked-files' is bound to `F' by dired-x.el.
1311;;; 1310;;;
1312;;; * Use `dired-get-marked-files' to collect the marked files in the current 1311;; * Use `dired-get-marked-files' to collect the marked files in the current
1313;;; Dired Buffer into a list of filenames `FILE-LIST'. 1312;;; Dired Buffer into a list of filenames `FILE-LIST'.
1314;;; 1313;;;
1315;;; * Pass FILE-LIST to `dired-simultaneous-find-file' all with 1314;; * Pass FILE-LIST to `dired-simultaneous-find-file' all with
1316;;; `dired-do-find-marked-files''s prefix argument NOSELECT. 1315;;; `dired-do-find-marked-files''s prefix argument NOSELECT.
1317;;; 1316;;;
1318;;; * `dired-simultaneous-find-file' runs through FILE-LIST decrementing the 1317;; * `dired-simultaneous-find-file' runs through FILE-LIST decrementing the
1319;;; list each time. 1318;;; list each time.
1320;;; 1319;;;
1321;;; * If NOSELECT is non-nil then just run `find-file-noselect' on each 1320;; * If NOSELECT is non-nil then just run `find-file-noselect' on each
1322;;; element of FILE-LIST. 1321;;; element of FILE-LIST.
1323;;; 1322;;;
1324;;; * If NOSELECT is nil then calculate the `size' of the window for each file 1323;; * If NOSELECT is nil then calculate the `size' of the window for each file
1325;;; by dividing the `window-height' by length of FILE-LIST. Thus, `size' is 1324;;; by dividing the `window-height' by length of FILE-LIST. Thus, `size' is
1326;;; cognizant of the window-configuration. 1325;;; cognizant of the window-configuration.
1327;;; 1326;;;
1328;;; * If `size' is too small abort, otherwise run `find-file' on each element 1327;; * If `size' is too small abort, otherwise run `find-file' on each element
1329;;; of FILE-LIST giving each a window of height `size'. 1328;;; of FILE-LIST giving each a window of height `size'.
1330 1329
1331(defun dired-do-find-marked-files (&optional noselect) 1330(defun dired-do-find-marked-files (&optional noselect)
@@ -1387,7 +1386,7 @@ NOSELECT the files are merely found but not selected."
1387 1386
1388;;; MISCELLANEOUS COMMANDS. 1387;;; MISCELLANEOUS COMMANDS.
1389 1388
1390;;; Run man on files. 1389;; Run man on files.
1391 1390
1392(defun dired-man () 1391(defun dired-man ()
1393 "Run man on this file. Display old buffer if buffer name matches filename. 1392 "Run man on this file. Display old buffer if buffer name matches filename.
@@ -1400,14 +1399,14 @@ Uses `man.el' of \\[manual-entry] fame."
1400 "Man command: " (list file))))) 1399 "Man command: " (list file)))))
1401 (Man-getpage-in-background file))) 1400 (Man-getpage-in-background file)))
1402 1401
1403;;; Run Info on files. 1402;; Run Info on files.
1404 1403
1405(defun dired-info () 1404(defun dired-info ()
1406 "Run info on this file." 1405 "Run info on this file."
1407 (interactive) 1406 (interactive)
1408 (info (dired-get-filename))) 1407 (info (dired-get-filename)))
1409 1408
1410;;; Run mail on mail folders. 1409;; Run mail on mail folders.
1411 1410
1412;; Avoid compiler warning. 1411;; Avoid compiler warning.
1413(eval-when-compile 1412(eval-when-compile
@@ -1453,8 +1452,8 @@ See also variable `dired-vm-read-only-folders'."
1453 (fset 'dired-old-find-buffer-nocreate 1452 (fset 'dired-old-find-buffer-nocreate
1454 (symbol-function 'dired-find-buffer-nocreate))) 1453 (symbol-function 'dired-find-buffer-nocreate)))
1455 1454
1456;;; REDEFINE. 1455;; REDEFINE.
1457;;; Redefines dired.el's version of `dired-find-buffer-nocreate' 1456;; Redefines dired.el's version of `dired-find-buffer-nocreate'
1458(defun dired-find-buffer-nocreate (dirname &optional mode) 1457(defun dired-find-buffer-nocreate (dirname &optional mode)
1459 (if (and dired-find-subdir 1458 (if (and dired-find-subdir
1460 ;; don't try to find a wildcard as a subdirectory 1459 ;; don't try to find a wildcard as a subdirectory
@@ -1485,33 +1484,31 @@ See also variable `dired-vm-read-only-folders'."
1485 (setq list (cdr list))) 1484 (setq list (cdr list)))
1486 more-recent))) 1485 more-recent)))
1487 1486
1488;;; Same thing as `dired-buffers-for-dir' of dired.el? - lrd 11/23/93 1487;; Same thing as `dired-buffers-for-dir' of dired.el? - lrd 11/23/93
1489;;; (defun dired-buffers-for-dir-exact (dir) 1488;; (defun dired-buffers-for-dir-exact (dir)
1490;;; ;; Return a list of buffers that dired DIR (a directory or wildcard) 1489;; ;; Return a list of buffers that dired DIR (a directory or wildcard)
1491;;; ;; at top level, or as subdirectory. 1490;; ;; at top level, or as subdirectory.
1492;;; ;; Top level matches must match the wildcard part too, if any. 1491;; ;; Top level matches must match the wildcard part too, if any.
1493;;; ;; The list is in reverse order of buffer creation, most recent last. 1492;; ;; The list is in reverse order of buffer creation, most recent last.
1494;;; ;; As a side effect, killed dired buffers for DIR are removed from 1493;; ;; As a side effect, killed dired buffers for DIR are removed from
1495;;; ;; dired-buffers. 1494;; ;; dired-buffers.
1496;;; (let ((alist dired-buffers) result elt) 1495;; (let ((alist dired-buffers) result elt)
1497;;; (while alist 1496;; (while alist
1498;;; (setq elt (car alist) 1497;; (setq elt (car alist)
1499;;; alist (cdr alist)) 1498;; alist (cdr alist))
1500;;; (let ((buf (cdr elt))) 1499;; (let ((buf (cdr elt)))
1501;;; (if (buffer-name buf) 1500;; (if (buffer-name buf)
1502;;; ;; Top level must match exactly against dired-directory in 1501;; ;; Top level must match exactly against dired-directory in
1503;;; ;; case one of them is a wildcard. 1502;; ;; case one of them is a wildcard.
1504;;; (if (or (equal dir (save-excursion (set-buffer buf) 1503;; (if (or (equal dir (with-current-buffer buf dired-directory))
1505;;; dired-directory)) 1504;; (assoc dir (with-current-buffer buf dired-subdir-alist)))
1506;;; (assoc dir (save-excursion (set-buffer buf) 1505;; (setq result (cons buf result)))
1507;;; dired-subdir-alist))) 1506;; ;; else buffer is killed - clean up:
1508;;; (setq result (cons buf result))) 1507;; (setq dired-buffers (delq elt dired-buffers)))))
1509;;; ;; else buffer is killed - clean up: 1508;; result))
1510;;; (setq dired-buffers (delq elt dired-buffers))))) 1509
1511;;; result)) 1510;; REDEFINE.
1512 1511;; Redefines dired.el's version of `dired-initial-position'
1513;;; REDEFINE.
1514;;; Redefines dired.el's version of `dired-initial-position'
1515(defun dired-initial-position (dirname) 1512(defun dired-initial-position (dirname)
1516 "Where point should go in a new listing of DIRNAME. 1513 "Where point should go in a new listing of DIRNAME.
1517Point assumed at beginning of new subdir line. 1514Point assumed at beginning of new subdir line.
@@ -1627,8 +1624,8 @@ Similarly for `dired-x-find-file-other-window' over `find-file-other-window'.
1627If you change this variable after `dired-x.el' is loaded then do 1624If you change this variable after `dired-x.el' is loaded then do
1628\\[dired-x-bind-find-file].") 1625\\[dired-x-bind-find-file].")
1629 1626
1630;;; Bind `dired-x-find-file{-other-window}' over wherever 1627;; Bind `dired-x-find-file{-other-window}' over wherever
1631;;; `find-file{-other-window}' is bound? 1628;; `find-file{-other-window}' is bound?
1632(defun dired-x-bind-find-file () 1629(defun dired-x-bind-find-file ()
1633 "Bind `dired-x-find-file' in place of `find-file' \(or reverse\). 1630 "Bind `dired-x-find-file' in place of `find-file' \(or reverse\).
1634Similarly for `dired-x-find-file-other-window' and `find-file-other-window'. 1631Similarly for `dired-x-find-file-other-window' and `find-file-other-window'.
@@ -1655,8 +1652,8 @@ This function is part of `after-init-hook'."
1655 ;; Clear mini-buffer. 1652 ;; Clear mini-buffer.
1656 (message nil)) 1653 (message nil))
1657 1654
1658;;; Now call it so binding is correct and put on `after-init-hook' in case 1655;; Now call it so binding is correct and put on `after-init-hook' in case
1659;;; user changes binding. 1656;; user changes binding.
1660(dired-x-bind-find-file) 1657(dired-x-bind-find-file)
1661(add-hook 'after-init-hook 'dired-x-bind-find-file) 1658(add-hook 'after-init-hook 'dired-x-bind-find-file)
1662 1659
@@ -1741,8 +1738,8 @@ If `current-prefix-arg' is non-nil, uses name at point as guess."
1741 1738
1742;; Fixme: get rid of this later. 1739;; Fixme: get rid of this later.
1743 1740
1744;;; This section is provided for reports. It uses Barry A. Warsaw's 1741;; This section is provided for reports. It uses Barry A. Warsaw's
1745;;; reporter.el which is bundled with GNU Emacs v19. 1742;; reporter.el which is bundled with GNU Emacs v19.
1746 1743
1747(defconst dired-x-help-address "bug-gnu-emacs@gnu.org" 1744(defconst dired-x-help-address "bug-gnu-emacs@gnu.org"
1748 "Address(es) accepting submission of reports on dired-x.el.") 1745 "Address(es) accepting submission of reports on dired-x.el.")