emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103350: Merge dired-x's dired-read-s


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103350: Merge dired-x's dired-read-shell-command into dired-aux's version.
Date: Sat, 19 Feb 2011 11:20:38 -0800
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103350
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Sat 2011-02-19 11:20:38 -0800
message:
  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.
modified:
  doc/misc/ChangeLog
  doc/misc/dired-x.texi
  lisp/ChangeLog
  lisp/dired-aux.el
  lisp/dired-x.el
=== modified file 'doc/misc/ChangeLog'
--- a/doc/misc/ChangeLog        2011-02-19 18:55:15 +0000
+++ b/doc/misc/ChangeLog        2011-02-19 19:20:38 +0000
@@ -1,7 +1,8 @@
 2011-02-19  Glenn Morris  <address@hidden>
 
        * 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  <address@hidden>
 

=== modified file 'doc/misc/dired-x.texi'
--- a/doc/misc/dired-x.texi     2011-02-19 18:55:15 +0000
+++ b/doc/misc/dired-x.texi     2011-02-19 19:20:38 +0000
@@ -177,15 +177,16 @@
 @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
address@hidden 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}.
address@hidden 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

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-02-19 18:55:15 +0000
+++ b/lisp/ChangeLog    2011-02-19 19:20:38 +0000
@@ -1,5 +1,8 @@
 2011-02-19  Glenn Morris  <address@hidden>
 
+       * 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.

=== modified file 'lisp/dired-aux.el'
--- a/lisp/dired-aux.el 2011-02-19 03:53:35 +0000
+++ b/lisp/dired-aux.el 2011-02-19 19:20:38 +0000
@@ -509,18 +509,22 @@
 
 ;; 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)

=== modified file 'lisp/dired-x.el'
--- a/lisp/dired-x.el   2011-02-19 18:55:15 +0000
+++ b/lisp/dired-x.el   2011-02-19 19:20:38 +0000
@@ -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 @@
 
 ;; 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 @@
       ;; 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.
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]