Mercurial > emacs
comparison lisp/dired-x.el @ 90203:187d6a1f84f7
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-71
Merge from emacs--cvs-trunk--0
Patches applied:
* emacs--cvs-trunk--0 (patch 485-492)
- Update from CVS
- Merge from gnus--rel--5.10
* gnus--rel--5.10 (patch 92-94)
- Merge from emacs--cvs-trunk--0
- Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Fri, 22 Jul 2005 08:27:27 +0000 |
parents | f9a65d7ebd29 725c23089fbb |
children | 2d92f5c9d6ae |
comparison
equal
deleted
inserted
replaced
90202:7597b4a23c3b | 90203:187d6a1f84f7 |
---|---|
155 :group 'dired-x) | 155 :group 'dired-x) |
156 | 156 |
157 (define-minor-mode dired-omit-mode | 157 (define-minor-mode dired-omit-mode |
158 "Toggle Dired-Omit mode. | 158 "Toggle Dired-Omit mode. |
159 With numeric ARG, enable Dired-Omit mode if ARG is positive, disable | 159 With numeric ARG, enable Dired-Omit mode if ARG is positive, disable |
160 otherwise. Enabling and disabling is buffer-local. | 160 otherwise. Enabling and disabling is buffer-local. |
161 If enabled, \"uninteresting\" files are not listed. | 161 If enabled, \"uninteresting\" files are not listed. |
162 Uninteresting files are those whose filenames match regexp `dired-omit-files', | 162 Uninteresting files are those whose filenames match regexp `dired-omit-files', |
163 plus those ending with extensions in `dired-omit-extensions'." | 163 plus those ending with extensions in `dired-omit-extensions'." |
164 :group 'dired-x | 164 :group 'dired-x |
165 (if dired-omit-mode | 165 (if dired-omit-mode |
183 (defcustom dired-find-subdir nil ; t is pretty near to DWIM... | 183 (defcustom dired-find-subdir nil ; t is pretty near to DWIM... |
184 "*If non-nil, Dired always finds a directory in a buffer of its own. | 184 "*If non-nil, Dired always finds a directory in a buffer of its own. |
185 If nil, Dired finds the directory as a subdirectory in some other buffer | 185 If nil, Dired finds the directory as a subdirectory in some other buffer |
186 if it is present as one. | 186 if it is present as one. |
187 | 187 |
188 If there are several Dired buffers for a directory, the most recently | 188 If there are several dired buffers for a directory, the most recently |
189 used is chosen. | 189 used is chosen. |
190 | 190 |
191 Dired avoids switching to the current buffer, so that if you have | 191 Dired avoids switching to the current buffer, so that if you have |
192 a normal and a wildcard buffer for the same directory, \\[dired] will | 192 a normal and a wildcard buffer for the same directory, \\[dired] will |
193 toggle between those two." | 193 toggle between those two." |
199 If nil, there is no maximum size." | 199 If nil, there is no maximum size." |
200 :type '(choice (const :tag "no maximum" nil) integer) | 200 :type '(choice (const :tag "no maximum" nil) integer) |
201 :group 'dired-x) | 201 :group 'dired-x) |
202 | 202 |
203 (defcustom dired-enable-local-variables t | 203 (defcustom dired-enable-local-variables t |
204 "*Control use of local-variables lists in dired. | 204 "*Control use of local-variables lists in Dired. |
205 The value can be t, nil or something else. | 205 The value can be t, nil or something else. |
206 A value of t means local-variables lists are obeyed; | 206 A value of t means local-variables lists are obeyed; |
207 nil means they are ignored; anything else means query. | 207 nil means they are ignored; anything else means query. |
208 | 208 |
209 This temporarily overrides the value of `enable-local-variables' when listing | 209 This temporarily overrides the value of `enable-local-variables' when listing |
230 :type '(choice (const :tag "None" nil) | 230 :type '(choice (const :tag "None" nil) |
231 (string :tag "Switches")) | 231 (string :tag "Switches")) |
232 :group 'dired-x) | 232 :group 'dired-x) |
233 | 233 |
234 (defcustom dired-clean-up-buffers-too t | 234 (defcustom dired-clean-up-buffers-too t |
235 "*Non-nil means offer to kill buffers visiting files and dirs deleted in dired." | 235 "*Non-nil means offer to kill buffers visiting files and dirs deleted in Dired." |
236 :type 'boolean | 236 :type 'boolean |
237 :group 'dired-x) | 237 :group 'dired-x) |
238 | 238 |
239 ;;; KEY BINDINGS. | 239 ;;; KEY BINDINGS. |
240 | 240 |
269 | 269 |
270 (add-hook 'dired-mode-hook 'dired-extra-startup) | 270 (add-hook 'dired-mode-hook 'dired-extra-startup) |
271 (add-hook 'dired-after-readin-hook 'dired-omit-expunge) | 271 (add-hook 'dired-after-readin-hook 'dired-omit-expunge) |
272 | 272 |
273 (defun dired-extra-startup () | 273 (defun dired-extra-startup () |
274 "Automatically put on `dired-mode-hook' to get extra dired features: | 274 "Automatically put on `dired-mode-hook' to get extra Dired features: |
275 \\<dired-mode-map> | 275 \\<dired-mode-map> |
276 \\[dired-do-run-mail]\t-- run mail on folder (see `dired-bind-vm') | 276 \\[dired-do-run-mail]\t-- run mail on folder (see `dired-bind-vm') |
277 \\[dired-info]\t-- run info on file | 277 \\[dired-info]\t-- run info on file |
278 \\[dired-man]\t-- run man on file | 278 \\[dired-man]\t-- run man on file |
279 \\[dired-do-find-marked-files]\t-- visit all marked files simultaneously | 279 \\[dired-do-find-marked-files]\t-- visit all marked files simultaneously |
280 \\[dired-omit-mode]\t-- toggle omitting of files | 280 \\[dired-omit-mode]\t-- toggle omitting of files |
281 \\[dired-mark-sexp]\t-- mark by Lisp expression | 281 \\[dired-mark-sexp]\t-- mark by Lisp expression |
282 \\[dired-copy-filename-as-kill]\t-- copy the file or subdir names into the kill ring. | 282 \\[dired-copy-filename-as-kill]\t-- copy the file or subdir names into the kill ring; |
283 \t You can feed it to other commands using \\[yank]. | 283 \t you can feed it to other commands using \\[yank] |
284 | 284 |
285 For more features, see variables | 285 For more features, see variables |
286 | 286 |
287 `dired-bind-vm' | 287 `dired-bind-vm' |
288 `dired-bind-jump' | 288 `dired-bind-jump' |
355 ;;; EXTENSION MARKING FUNCTIONS. | 355 ;;; EXTENSION MARKING FUNCTIONS. |
356 | 356 |
357 ;;; Mark files with some extension. | 357 ;;; Mark files with some extension. |
358 (defun dired-mark-extension (extension &optional marker-char) | 358 (defun dired-mark-extension (extension &optional marker-char) |
359 "Mark all files with a certain EXTENSION for use in later commands. | 359 "Mark all files with a certain EXTENSION for use in later commands. |
360 A `.' is not automatically prepended to the string entered." | 360 A `.' is *not* automatically prepended to the string entered." |
361 ;; EXTENSION may also be a list of extensions instead of a single one. | 361 ;; EXTENSION may also be a list of extensions instead of a single one. |
362 ;; Optional MARKER-CHAR is marker to use. | 362 ;; Optional MARKER-CHAR is marker to use. |
363 (interactive "sMarking extension: \nP") | 363 (interactive "sMarking extension: \nP") |
364 (or (listp extension) | 364 (or (listp extension) |
365 (setq extension (list extension))) | 365 (setq extension (list extension))) |
432 | 432 |
433 ;;;###autoload | 433 ;;;###autoload |
434 (defun dired-jump (&optional other-window) | 434 (defun dired-jump (&optional other-window) |
435 "Jump to dired buffer corresponding to current buffer. | 435 "Jump to dired buffer corresponding to current buffer. |
436 If in a file, dired the current directory and move to file's line. | 436 If in a file, dired the current directory and move to file's line. |
437 If in dired already, pop up a level and goto old directory's line. | 437 If in Dired already, pop up a level and goto old directory's line. |
438 In case the proper dired file line cannot be found, refresh the dired | 438 In case the proper dired file line cannot be found, refresh the dired |
439 buffer and try again." | 439 buffer and try again." |
440 (interactive "P") | 440 (interactive "P") |
441 (let* ((file buffer-file-name) | 441 (let* ((file buffer-file-name) |
442 (dir (if file (file-name-directory file) default-directory))) | 442 (dir (if file (file-name-directory file) default-directory))) |
463 (progn | 463 (progn |
464 (dired-omit-mode) | 464 (dired-omit-mode) |
465 (dired-goto-file file)))))))) | 465 (dired-goto-file file)))))))) |
466 | 466 |
467 (defun dired-jump-other-window () | 467 (defun dired-jump-other-window () |
468 "Like \\[dired-jump] (dired-jump) but in other window." | 468 "Like \\[dired-jump] (`dired-jump') but in other window." |
469 (interactive) | 469 (interactive) |
470 (dired-jump t)) | 470 (dired-jump t)) |
471 | 471 |
472 ;;; OMITTING. | 472 ;;; OMITTING. |
473 | 473 |
476 | 476 |
477 ;; should probably get rid of this and always use 'no-dir. | 477 ;; should probably get rid of this and always use 'no-dir. |
478 ;; sk 28-Aug-1991 09:37 | 478 ;; sk 28-Aug-1991 09:37 |
479 (defvar dired-omit-localp 'no-dir | 479 (defvar dired-omit-localp 'no-dir |
480 "The LOCALP argument `dired-omit-expunge' passes to `dired-get-filename'. | 480 "The LOCALP argument `dired-omit-expunge' passes to `dired-get-filename'. |
481 If it is 'no-dir, omitting is much faster, but you can only match | 481 If it is `no-dir', omitting is much faster, but you can only match |
482 against the non-directory part of the file name. Set it to nil if you | 482 against the non-directory part of the file name. Set it to nil if you |
483 need to match the entire file name.") | 483 need to match the entire file name.") |
484 | 484 |
485 ;; \017=^O for Omit - other packages can chose other control characters. | 485 ;; \017=^O for Omit - other packages can chose other control characters. |
486 (defvar dired-omit-marker-char ?\017 | 486 (defvar dired-omit-marker-char ?\017 |
487 "Temporary marker used by by dired-omit. | 487 "Temporary marker used by dired-omit. |
488 Should never be used as marker by the user or other packages.") | 488 Should never be used as marker by the user or other packages.") |
489 | 489 |
490 (defun dired-omit-startup () | 490 (defun dired-omit-startup () |
491 (or (assq 'dired-omit-mode minor-mode-alist) | 491 (or (assq 'dired-omit-mode minor-mode-alist) |
492 (setq minor-mode-alist | 492 (setq minor-mode-alist |
567 (defun dired-mark-unmarked-files (regexp msg &optional unflag-p localp) | 567 (defun dired-mark-unmarked-files (regexp msg &optional unflag-p localp) |
568 "Mark unmarked files matching REGEXP, displaying MSG. | 568 "Mark unmarked files matching REGEXP, displaying MSG. |
569 REGEXP is matched against the entire file name. | 569 REGEXP is matched against the entire file name. |
570 Does not re-mark files which already have a mark. | 570 Does not re-mark files which already have a mark. |
571 With prefix argument, unflag all those files. | 571 With prefix argument, unflag all those files. |
572 Second optional argument LOCALP is as in `dired-get-filename'." | 572 Optional fourth argument LOCALP is as in `dired-get-filename'." |
573 (interactive "P") | 573 (interactive "P") |
574 (let ((dired-marker-char (if unflag-p ?\ dired-marker-char))) | 574 (let ((dired-marker-char (if unflag-p ?\s dired-marker-char))) |
575 (dired-mark-if | 575 (dired-mark-if |
576 (and | 576 (and |
577 ;; not already marked | 577 ;; not already marked |
578 (looking-at " ") | 578 (looking-at " ") |
579 ;; uninteresting | 579 ;; uninteresting |
619 | 619 |
620 ;;; VIRTUAL DIRED MODE. | 620 ;;; VIRTUAL DIRED MODE. |
621 | 621 |
622 ;;; For browsing `ls -lR' listings in a dired-like fashion. | 622 ;;; For browsing `ls -lR' listings in a dired-like fashion. |
623 | 623 |
624 (fset 'virtual-dired 'dired-virtual) | 624 (defalias 'virtual-dired 'dired-virtual) |
625 (defun dired-virtual (dirname &optional switches) | 625 (defun dired-virtual (dirname &optional switches) |
626 "Put this buffer into Virtual Dired mode. | 626 "Put this buffer into Virtual Dired mode. |
627 | 627 |
628 In Virtual Dired mode, all commands that do not actually consult the | 628 In Virtual Dired mode, all commands that do not actually consult the |
629 filesystem will work. | 629 filesystem will work. |
636 buffer. | 636 buffer. |
637 | 637 |
638 If you have save a Dired buffer in a file you can use \\[dired-virtual] to | 638 If you have save a Dired buffer in a file you can use \\[dired-virtual] to |
639 resume it in a later session. | 639 resume it in a later session. |
640 | 640 |
641 Type \\<dired-mode-map>\\[revert-buffer] in the | 641 Type \\<dired-mode-map>\\[revert-buffer] \ |
642 Virtual Dired buffer and answer `y' to convert the virtual to a real | 642 in the Virtual Dired buffer and answer `y' to convert |
643 dired buffer again. You don't have to do this, though: you can relist | 643 the virtual to a real dired buffer again. You don't have to do this, though: |
644 single subdirs using \\[dired-do-redisplay]." | 644 you can relist single subdirs using \\[dired-do-redisplay]." |
645 | 645 |
646 ;; DIRNAME is the top level directory of the buffer. It will become | 646 ;; DIRNAME is the top level directory of the buffer. It will become |
647 ;; its `default-directory'. If nil, the old value of | 647 ;; its `default-directory'. If nil, the old value of |
648 ;; default-directory is used. | 648 ;; default-directory is used. |
649 | 649 |
723 ;; A zero-arg version of dired-virtual. | 723 ;; A zero-arg version of dired-virtual. |
724 ;; You need my modified version of set-auto-mode for the | 724 ;; You need my modified version of set-auto-mode for the |
725 ;; `buffer-contents-mode-alist'. | 725 ;; `buffer-contents-mode-alist'. |
726 ;; Or you use infer-mode.el and infer-mode-alist, same syntax. | 726 ;; Or you use infer-mode.el and infer-mode-alist, same syntax. |
727 (defun dired-virtual-mode () | 727 (defun dired-virtual-mode () |
728 "Put current buffer into virtual dired mode (see `dired-virtual'). | 728 "Put current buffer into Virtual Dired mode (see `dired-virtual'). |
729 Useful on `buffer-contents-mode-alist' (which see) with the regexp | 729 Useful on `buffer-contents-mode-alist' (which see) with the regexp |
730 | 730 |
731 \"^ \\(/[^ /]+\\)/?+:$\" | 731 \"^ \\(/[^ /]+\\)/?+:$\" |
732 | 732 |
733 to put saved dired buffers automatically into virtual dired mode. | 733 to put saved dired buffers automatically into Virtual Dired mode. |
734 | 734 |
735 Also useful for `auto-mode-alist' (which see) like this: | 735 Also useful for `auto-mode-alist' (which see) like this: |
736 | 736 |
737 \(setq auto-mode-alist (cons '(\"[^/]\\.dired\\'\" . dired-virtual-mode) | 737 \(setq auto-mode-alist (cons '(\"[^/]\\.dired\\'\" . dired-virtual-mode) |
738 auto-mode-alist)\)" | 738 auto-mode-alist)\)" |
766 Knows about the special cases in variable `default-directory-alist'." | 766 Knows about the special cases in variable `default-directory-alist'." |
767 (or (eval (cdr (assq major-mode default-directory-alist))) | 767 (or (eval (cdr (assq major-mode default-directory-alist))) |
768 default-directory)) | 768 default-directory)) |
769 | 769 |
770 (defun dired-smart-shell-command (cmd &optional insert) | 770 (defun dired-smart-shell-command (cmd &optional insert) |
771 "Like function `shell-command', but in the current Tree Dired directory." | 771 "Like function `shell-command', but in the current Virtual Dired directory." |
772 (interactive (list (read-from-minibuffer "Shell command: " | 772 (interactive (list (read-from-minibuffer "Shell command: " |
773 nil nil nil 'shell-command-history) | 773 nil nil nil 'shell-command-history) |
774 current-prefix-arg)) | 774 current-prefix-arg)) |
775 (let ((default-directory (dired-default-directory))) | 775 (let ((default-directory (dired-default-directory))) |
776 (shell-command cmd insert))) | 776 (shell-command cmd insert))) |
798 ;;; Dired Buffer. | 798 ;;; Dired Buffer. |
799 | 799 |
800 (defvar dired-local-variables-file (convert-standard-filename ".dired") | 800 (defvar dired-local-variables-file (convert-standard-filename ".dired") |
801 "Filename, as string, containing local dired buffer variables to be hacked. | 801 "Filename, as string, containing local dired buffer variables to be hacked. |
802 If this file found in current directory, then it will be inserted into dired | 802 If this file found in current directory, then it will be inserted into dired |
803 buffer and `hack-local-variables' will be run. See Emacs Info pages for more | 803 buffer and `hack-local-variables' will be run. See Info node |
804 information on local variables. See also `dired-enable-local-variables'.") | 804 `(emacs)File Variables' for more information on local variables. |
805 See also `dired-enable-local-variables'.") | |
805 | 806 |
806 (defun dired-hack-local-variables () | 807 (defun dired-hack-local-variables () |
807 "Evaluate local variables in `dired-local-variables-file' for dired buffer." | 808 "Evaluate local variables in `dired-local-variables-file' for dired buffer." |
808 (if (and dired-local-variables-file | 809 (if (and dired-local-variables-file |
809 (stringp dired-local-variables-file) | 810 (stringp dired-local-variables-file) |
826 ;; Delete this stuff: `eobp' is used to find last subdir by dired.el. | 827 ;; Delete this stuff: `eobp' is used to find last subdir by dired.el. |
827 (delete-region opoint (point-max))))) | 828 (delete-region opoint (point-max))))) |
828 | 829 |
829 (defun dired-omit-here-always () | 830 (defun dired-omit-here-always () |
830 "Create `dired-local-variables-file' for omitting and reverts directory. | 831 "Create `dired-local-variables-file' for omitting and reverts directory. |
831 Sets dired-omit-file-p to t in a local variables file that is readable by | 832 Sets `dired-omit-mode' to t in a local variables file that is readable by |
832 dired." | 833 dired." |
833 (interactive) | 834 (interactive) |
834 (if (file-exists-p dired-local-variables-file) | 835 (if (file-exists-p dired-local-variables-file) |
835 (message "File `./%s' already exists." dired-local-variables-file) | 836 (message "File `./%s' already exists." dired-local-variables-file) |
836 | 837 |
1022 | 1023 |
1023 Each element of this list looks like | 1024 Each element of this list looks like |
1024 | 1025 |
1025 \(REGEXP COMMAND...\) | 1026 \(REGEXP COMMAND...\) |
1026 | 1027 |
1027 where each COMMAND can either be a string or a lisp expression that evaluates | 1028 where each COMMAND can either be a string or a Lisp expression that evaluates |
1028 to a string. If several COMMANDs are given, the first one will be the default | 1029 to a string. If several COMMANDs are given, the first one will be the default |
1029 and the rest will be added temporarily to the history and can be retrieved | 1030 and the rest will be added temporarily to the history and can be retrieved |
1030 with \\[previous-history-element] (M-p) . | 1031 with \\[previous-history-element] (M-p) . |
1031 | 1032 |
1032 You can set this variable in your ~/.emacs. For example, to add rules for | 1033 You can set this variable in your ~/.emacs. For example, to add rules for |
1221 foo -> /ugly/file/name/that/may/change/any/day/bar/foo" | 1222 foo -> /ugly/file/name/that/may/change/any/day/bar/foo" |
1222 (interactive "P") | 1223 (interactive "P") |
1223 (dired-do-create-files 'relsymlink (function dired-make-relative-symlink) | 1224 (dired-do-create-files 'relsymlink (function dired-make-relative-symlink) |
1224 "RelSymLink" arg dired-keep-marker-relsymlink)) | 1225 "RelSymLink" arg dired-keep-marker-relsymlink)) |
1225 | 1226 |
1226 (defun dired-do-relsymlink-regexp (regexp newname &optional whole-name) | 1227 (defun dired-do-relsymlink-regexp (regexp newname &optional arg whole-name) |
1227 "RelSymlink all marked files containing REGEXP to NEWNAME. | 1228 "RelSymlink all marked files containing REGEXP to NEWNAME. |
1228 See functions `dired-do-rename-regexp' and `dired-do-relsymlink' | 1229 See functions `dired-do-rename-regexp' and `dired-do-relsymlink' |
1229 for more info." | 1230 for more info." |
1230 (interactive (dired-mark-read-regexp "RelSymLink")) | 1231 (interactive (dired-mark-read-regexp "RelSymLink")) |
1231 (dired-do-create-files-regexp | 1232 (dired-do-create-files-regexp |
1232 (function dired-make-relative-symlink) | 1233 (function dired-make-relative-symlink) |
1233 "RelSymLink" nil regexp newname whole-name dired-keep-marker-relsymlink)) | 1234 "RelSymLink" arg regexp newname whole-name dired-keep-marker-relsymlink)) |
1234 | 1235 |
1235 | 1236 |
1236 ;;; VISIT ALL MARKED FILES SIMULTANEOUSLY. | 1237 ;;; VISIT ALL MARKED FILES SIMULTANEOUSLY. |
1237 | 1238 |
1238 ;;; Brief Description: | 1239 ;;; Brief Description: |
1319 | 1320 |
1320 ;;; Run man on files. | 1321 ;;; Run man on files. |
1321 | 1322 |
1322 (defun dired-man () | 1323 (defun dired-man () |
1323 "Run man on this file. Display old buffer if buffer name matches filename. | 1324 "Run man on this file. Display old buffer if buffer name matches filename. |
1324 Uses ../lisp/man.el of \\[manual-entry] fame." | 1325 Uses `man.el' of \\[manual-entry] fame." |
1325 (interactive) | 1326 (interactive) |
1326 (require 'man) | 1327 (require 'man) |
1327 (let* ((file (dired-get-filename)) | 1328 (let* ((file (dired-get-filename)) |
1328 (manual-program (replace-regexp-in-string "\\*" "%s" | 1329 (manual-program (replace-regexp-in-string "\\*" "%s" |
1329 (dired-guess-shell-command | 1330 (dired-guess-shell-command |
1439 ;;; REDEFINE. | 1440 ;;; REDEFINE. |
1440 ;;; Redefines dired.el's version of `dired-initial-position' | 1441 ;;; Redefines dired.el's version of `dired-initial-position' |
1441 (defun dired-initial-position (dirname) | 1442 (defun dired-initial-position (dirname) |
1442 "Where point should go in a new listing of DIRNAME. | 1443 "Where point should go in a new listing of DIRNAME. |
1443 Point assumed at beginning of new subdir line. | 1444 Point assumed at beginning of new subdir line. |
1444 You may redefine this function as you wish, e.g. like in dired-x.el." | 1445 You may redefine this function as you wish, e.g. like in `dired-x.el'." |
1445 (end-of-line) | 1446 (end-of-line) |
1446 (if dired-find-subdir (dired-goto-subdir dirname)) ; new | 1447 (if dired-find-subdir (dired-goto-subdir dirname)) ; new |
1447 (if dired-trivial-filenames (dired-goto-next-nontrivial-file))) | 1448 (if dired-trivial-filenames (dired-goto-next-nontrivial-file))) |
1448 | 1449 |
1449 | 1450 |
1548 ;;; FIND FILE AT POINT. | 1549 ;;; FIND FILE AT POINT. |
1549 | 1550 |
1550 (defvar dired-x-hands-off-my-keys t | 1551 (defvar dired-x-hands-off-my-keys t |
1551 "*Non-nil means don't bind `dired-x-find-file' over `find-file' on keyboard. | 1552 "*Non-nil means don't bind `dired-x-find-file' over `find-file' on keyboard. |
1552 Similarly for `dired-x-find-file-other-window' over `find-file-other-window'. | 1553 Similarly for `dired-x-find-file-other-window' over `find-file-other-window'. |
1553 If you change this variable after dired-x.el is loaded then do | 1554 If you change this variable after `dired-x.el' is loaded then do |
1554 \\[dired-x-bind-find-file].") | 1555 \\[dired-x-bind-find-file].") |
1555 | 1556 |
1556 ;;; Bind `dired-x-find-file{-other-window}' over wherever | 1557 ;;; Bind `dired-x-find-file{-other-window}' over wherever |
1557 ;;; `find-file{-other-window}' is bound? | 1558 ;;; `find-file{-other-window}' is bound? |
1558 (defun dired-x-bind-find-file () | 1559 (defun dired-x-bind-find-file () |
1559 "Bind `dired-x-find-file' in place of `find-file' \(or reverse\). | 1560 "Bind `dired-x-find-file' in place of `find-file' \(or reverse\). |
1560 Similarly for `dired-x-find-file-other-window' and `find-file-other-window'. | 1561 Similarly for `dired-x-find-file-other-window' and `find-file-other-window'. |
1561 Binding direction based on `dired-x-hands-off-my-keys'. | 1562 Binding direction based on `dired-x-hands-off-my-keys'. |
1562 This function part of `after-init-hook'." | 1563 This function is part of `after-init-hook'." |
1563 (interactive) | 1564 (interactive) |
1564 (if (interactive-p) | 1565 (if (interactive-p) |
1565 (setq dired-x-hands-off-my-keys | 1566 (setq dired-x-hands-off-my-keys |
1566 (not (y-or-n-p "Bind dired-x-find-file over find-file? ")))) | 1567 (not (y-or-n-p "Bind dired-x-find-file over find-file? ")))) |
1567 (cond ((not dired-x-hands-off-my-keys) | 1568 (cond ((not dired-x-hands-off-my-keys) |
1590 "Edit file FILENAME. | 1591 "Edit file FILENAME. |
1591 May create a new window, or reuse an existing one. | 1592 May create a new window, or reuse an existing one. |
1592 See the function `display-buffer'. | 1593 See the function `display-buffer'. |
1593 | 1594 |
1594 Identical to `find-file' except when called interactively, with a prefix arg | 1595 Identical to `find-file' except when called interactively, with a prefix arg |
1595 \(e.g., \\[universal-argument]\), in which case it guesses filename near | 1596 \(e.g., \\[universal-argument]\), in which case it guesses filename near point. |
1596 point. Useful for editing file mentioned in buffer you are viewing, or to | 1597 Useful for editing file mentioned in buffer you are viewing, |
1597 test if that file exists. Use minibuffer after snatching filename." | 1598 or to test if that file exists. Use minibuffer after snatching filename." |
1598 (interactive (list (read-filename-at-point "Find file: "))) | 1599 (interactive (list (read-filename-at-point "Find file: "))) |
1599 (find-file (expand-file-name filename))) | 1600 (find-file (expand-file-name filename))) |
1600 | 1601 |
1601 (defun dired-x-find-file-other-window (filename) | 1602 (defun dired-x-find-file-other-window (filename) |
1602 "Edit file FILENAME, in another window. | 1603 "Edit file FILENAME, in another window. |
1603 May create a new window, or reuse an existing one. | 1604 May create a new window, or reuse an existing one. |
1604 See the function `display-buffer'. | 1605 See the function `display-buffer'. |
1605 | 1606 |
1606 Identical to `find-file-other-window' except when called interactively, with a | 1607 Identical to `find-file-other-window' except when called interactively, with a |
1607 prefix arg \(e.g., \\[universal-argument]\), in which case it guesses filename | 1608 prefix arg \(e.g., \\[universal-argument]\), in which case it guesses filename near point. |
1608 near point. Useful for editing file mentioned in buffer you are viewing, or | 1609 Useful for editing file mentioned in buffer you are viewing, |
1609 to test if that file exists. Use minibuffer after snatching filename." | 1610 or to test if that file exists. Use minibuffer after snatching filename." |
1610 (interactive (list (read-filename-at-point "Find file: "))) | 1611 (interactive (list (read-filename-at-point "Find file: "))) |
1611 (find-file-other-window (expand-file-name filename))) | 1612 (find-file-other-window (expand-file-name filename))) |
1612 | 1613 |
1613 ;;; Internal functions. | 1614 ;;; Internal functions. |
1614 | 1615 |
1693 'dired-omit-extensions | 1694 'dired-omit-extensions |
1694 ) | 1695 ) |
1695 "List of variables to be appended to reports sent by `dired-x-submit-report'.") | 1696 "List of variables to be appended to reports sent by `dired-x-submit-report'.") |
1696 | 1697 |
1697 (defun dired-x-submit-report () | 1698 (defun dired-x-submit-report () |
1698 "Submit via reporter.el a bug report on program. | 1699 "Submit via `reporter.el' a bug report on program. |
1699 Send report on `dired-x-file' version `dired-x-version,' to | 1700 Send report on `dired-x-file' version `dired-x-version,' to |
1700 `dired-x-maintainer' at address `dired-x-help-address' listing | 1701 `dired-x-maintainer' at address `dired-x-help-address' listing |
1701 variables `dired-x-variable-list' in the message." | 1702 variables `dired-x-variable-list' in the message." |
1702 (interactive) | 1703 (interactive) |
1703 | 1704 |