diff options
-rw-r--r-- | doc/misc/ChangeLog | 3 | ||||
-rw-r--r-- | doc/misc/dired-x.texi | 13 | ||||
-rw-r--r-- | lisp/ChangeLog | 3 | ||||
-rw-r--r-- | lisp/dired-aux.el | 20 | ||||
-rw-r--r-- | lisp/dired-x.el | 27 |
5 files changed, 28 insertions, 38 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 359ed2aa906..a113577852d 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,7 +1,8 @@ 2011-02-19 Glenn Morris <rgm@gnu.org> * dired-x.texi (Technical Details): No longer redefines dired-add-entry, - dired-initial-position, or dired-clean-up-after-deletion. + dired-initial-position, dired-clean-up-after-deletion, or + dired-read-shell-command. 2011-02-18 Glenn Morris <rgm@gnu.org> diff --git a/doc/misc/dired-x.texi b/doc/misc/dired-x.texi index 3bc2964c1b3..4a542d9841b 100644 --- a/doc/misc/dired-x.texi +++ b/doc/misc/dired-x.texi @@ -177,15 +177,16 @@ Point}). @cindex Redefined functions @cindex @file{dired-aux.el} -When loaded this code @emph{redefines} some standard Dired functions. -From @file{dired.el}, the function @code{dired-find-buffer-nocreate}; -and from @file{dired-aux.el} the function @code{dired-read-shell-command}. -In addition, once @file{dired-x.el} is loaded, the following Dired -functions offer additional features. @code{dired-add-entry} obeys Dired -Omit mode (@pxref{Omitting Files in Dired}), if it is active. +When loaded this code @emph{redefines} the standard @file{dired.el} +function @code{dired-find-buffer-nocreate}. In addition, once +@file{dired-x.el} is loaded, the following Dired functions offer +additional features. @code{dired-add-entry} obeys Dired Omit mode +(@pxref{Omitting Files in Dired}), if it is active. @code{dired-initial-position} obeys @code{dired-find-subdir} (@pxref{Miscellaneous Commands}). @code{dired-clean-up-after-deletion} respects the value of @code{dired-clean-up-buffers-too}. +@code{dired-read-shell-command} uses @code{dired-guess-shell-command} +(@pxref{Shell Command Guessing}) to offer a smarter default command. @node Installation, Omitting Files in Dired, Introduction, Top @chapter Installation diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4d2479ba2bb..65d04bb861e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-02-19 Glenn Morris <rgm@gnu.org> + * dired-x.el (dired-read-shell-command): Merge into dired-aux's version. + * dired-aux.el (dired-read-shell-command): Merge dired-x's version. + * dired-x.el (dired-clean-up-after-deletion): Merge into dired.el. * dired.el (dired-clean-up-after-deletion): Merge dired-x's version. (dired-clean-up-buffers-too): Declare. diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index bf70262ee73..986c9edfd2d 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -509,18 +509,22 @@ to the end of the list of defaults just after the default value." ;; This is an extra function so that you can redefine it, e.g., to use gmhist. (defun dired-read-shell-command (prompt arg files) - "Read a dired shell command prompting with PROMPT (using `read-shell-command'). -ARG is the prefix arg and may be used to indicate in the prompt which -FILES are affected." + "Read a dired shell command prompting with PROMPT. +Passes the prefix argument ARG to `dired-mark-prompt', so that it +can be used in the prompt to indicate which FILES are affected. +Normally reads the command with `read-shell-command', but if the +`dired-x' packages is loaded, uses `dired-guess-shell-command' to offer +a smarter default choice of shell command." (minibuffer-with-setup-hook (lambda () (set (make-local-variable 'minibuffer-default-add-function) 'minibuffer-default-add-dired-shell-commands)) - (dired-mark-pop-up - nil 'shell files - #'read-shell-command - (format prompt (dired-mark-prompt arg files)) - nil nil))) + (setq prompt (format prompt (dired-mark-prompt arg files))) + (if (featurep 'dired-x) + (dired-mark-pop-up nil 'shell files + #'dired-guess-shell-command prompt files) + (dired-mark-pop-up nil 'shell files + #'read-shell-command prompt nil nil)))) ;;;###autoload (defun dired-do-async-shell-command (command &optional arg file-list) diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 1810d59712d..042fbe0b085 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -47,9 +47,7 @@ ;; User customization: M-x customize-group RET dired-x RET. -;; When loaded this code redefines the following functions of GNU Emacs: -;; From dired.el: dired-find-buffer-nocreate. -;; From dired-aux.el: dired-read-shell-command. +;; When loaded this code redefines dired.el's dired-find-buffer-nocreate. ;; *Please* see the `dired-x' info pages for more details. @@ -804,10 +802,10 @@ dired." ;; Brief Description: ;;; -;; `dired-do-shell-command' is bound to `!' by dired.el. +;; * `dired-do-shell-command' is bound to `!' by dired.el. ;;; -;; * Redefine `dired-read-shell-command' so it calls -;;; `dired-guess-shell-command'. +;; * `dired-guess-shell-command' provides smarter defaults for +;;; dired-aux.el's `dired-read-shell-command'. ;;; ;; * `dired-guess-shell-command' calls `dired-guess-default' with list of ;;; marked files. @@ -1094,23 +1092,6 @@ See `dired-guess-shell-alist-user'." ;; If we got a return, then return default. (if (equal val "") default val)))) -;; REDEFINE. -;; Redefine dired-aux.el's version: -(defun dired-read-shell-command (prompt arg files) - "Read a dired shell command prompting with PROMPT (using `read-shell-command'). -ARG is the prefix arg and may be used to indicate in the prompt which -FILES are affected. -This is an extra function so that you can redefine it." - (minibuffer-with-setup-hook - (lambda () - (set (make-local-variable 'minibuffer-default-add-function) - 'minibuffer-default-add-dired-shell-commands)) - (dired-mark-pop-up - nil 'shell files - 'dired-guess-shell-command - (format prompt (dired-mark-prompt arg files)) ; PROMPT - files))) ; FILES - ;;; RELATIVE SYMBOLIC LINKS. |