diff options
| author | Juri Linkov | 2008-04-22 19:54:27 +0000 |
|---|---|---|
| committer | Juri Linkov | 2008-04-22 19:54:27 +0000 |
| commit | d3a89b9eabd70a259fd670bd76fb350e61ace603 (patch) | |
| tree | 711cd876cf27b749b6295066c55ec0948f9e195b | |
| parent | 905eb9ff9ec2ae77b676ae8766a4ea1284eadbe2 (diff) | |
| download | emacs-d3a89b9eabd70a259fd670bd76fb350e61ace603.tar.gz emacs-d3a89b9eabd70a259fd670bd76fb350e61ace603.zip | |
(dired-smart-shell-command): Sync arguments and
interactive spec with changes in `shell-command'.
Use dired-get-filename to get the dired file name at point
as the default value in dired mode.
| -rw-r--r-- | lisp/ChangeLog | 32 | ||||
| -rw-r--r-- | lisp/dired-x.el | 19 |
2 files changed, 46 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7466a38b713..d7ae805cc10 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,35 @@ | |||
| 1 | 2008-04-22 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * minibuffer.el (internal-complete-buffer-except): New function. | ||
| 4 | |||
| 5 | * files.el (read-buffer-to-switch): New function. | ||
| 6 | (switch-to-buffer-other-window, switch-to-buffer-other-frame): | ||
| 7 | Change interactive spec to call read-buffer-to-switch instead of | ||
| 8 | using the letter "B". | ||
| 9 | |||
| 10 | * simple.el (minibuffer-default-add-shell-commands): New function. | ||
| 11 | Use declare-function for mailcap-file-default-commands from "mailcap". | ||
| 12 | (shell-command): Set local minibuffer-default-add-function to | ||
| 13 | minibuffer-default-add-shell-commands in minibuffer-with-setup-hook | ||
| 14 | before calling read-shell-command. Set 4th arg default-value of | ||
| 15 | read-shell-command to relative buffer-file-name in file buffers. | ||
| 16 | |||
| 17 | * dired-aux.el (dired-read-shell-command-default): Move it to | ||
| 18 | gnus/mailcap.el and change its name to more general name | ||
| 19 | mailcap-file-default-commands. | ||
| 20 | (minibuffer-default-add-dired-shell-commands): New function. | ||
| 21 | Use declare-function for mailcap-file-default-commands from "mailcap". | ||
| 22 | (dired-read-shell-command): Set local minibuffer-default-add-function | ||
| 23 | to minibuffer-default-add-dired-shell-commands in minibuffer-with-setup-hook | ||
| 24 | before calling read-shell-command. Remove dired-read-shell-command-default | ||
| 25 | from the default value arg because default values are not set in | ||
| 26 | minibuffer-default-add-dired-shell-commands. Doc fix. | ||
| 27 | |||
| 28 | * dired-x.el (dired-smart-shell-command): Sync arguments and | ||
| 29 | interactive spec with changes in `shell-command'. | ||
| 30 | Use dired-get-filename to get the dired file name at point | ||
| 31 | as the default value in dired mode. | ||
| 32 | |||
| 1 | 2008-04-22 Juanma Barranquero <lekktu@gmail.com> | 33 | 2008-04-22 Juanma Barranquero <lekktu@gmail.com> |
| 2 | 34 | ||
| 3 | * info.el (Info-complete-menu-item): Add missing parenthesis. | 35 | * info.el (Info-complete-menu-item): Add missing parenthesis. |
diff --git a/lisp/dired-x.el b/lisp/dired-x.el index bd695b322e5..22241a22c95 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el | |||
| @@ -838,13 +838,22 @@ Knows about the special cases in variable `default-directory-alist'." | |||
| 838 | (or (eval (cdr (assq major-mode default-directory-alist))) | 838 | (or (eval (cdr (assq major-mode default-directory-alist))) |
| 839 | default-directory)) | 839 | default-directory)) |
| 840 | 840 | ||
| 841 | (defun dired-smart-shell-command (cmd &optional insert) | 841 | (defun dired-smart-shell-command (command &optional output-buffer error-buffer) |
| 842 | "Like function `shell-command', but in the current Virtual Dired directory." | 842 | "Like function `shell-command', but in the current Virtual Dired directory." |
| 843 | (interactive (list (read-from-minibuffer "Shell command: " | 843 | (interactive |
| 844 | nil nil nil 'shell-command-history) | 844 | (list |
| 845 | current-prefix-arg)) | 845 | (minibuffer-with-setup-hook |
| 846 | (lambda () | ||
| 847 | (set (make-local-variable 'minibuffer-default-add-function) | ||
| 848 | 'minibuffer-default-add-shell-commands)) | ||
| 849 | (read-shell-command "Shell command: " nil nil | ||
| 850 | (cond | ||
| 851 | (buffer-file-name (file-relative-name buffer-file-name)) | ||
| 852 | ((eq major-mode 'dired-mode) (dired-get-filename t t))))) | ||
| 853 | current-prefix-arg | ||
| 854 | shell-command-default-error-buffer)) | ||
| 846 | (let ((default-directory (dired-default-directory))) | 855 | (let ((default-directory (dired-default-directory))) |
| 847 | (shell-command cmd insert))) | 856 | (shell-command command output-buffer error-buffer))) |
| 848 | 857 | ||
| 849 | 858 | ||
| 850 | ;;; LOCAL VARIABLES FOR DIRED BUFFERS. | 859 | ;;; LOCAL VARIABLES FOR DIRED BUFFERS. |