Commit d6e96966 authored by Glenn Morris's avatar Glenn Morris
Browse files

Merge dired-x's dired-read-shell-command into dired-aux's version.

* lisp/dired-x.el (dired-read-shell-command): Merge into dired-aux's version.

* lisp/dired-aux.el (dired-read-shell-command): Merge dired-x's version.

* doc/misc/dired-x.texi (Technical Details):
No longer redefines dired-read-shell-command.
parent 42924231
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>
......
......@@ -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
......
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.
......
......@@ -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)
......
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment