[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/dired-x.el,v
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/dired-x.el,v |
Date: |
Tue, 22 Apr 2008 19:52:38 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Juri Linkov <jurta> 08/04/22 19:52:37
Index: dired-x.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/dired-x.el,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -b -r1.88 -r1.89
--- dired-x.el 18 Apr 2008 09:32:42 -0000 1.88
+++ dired-x.el 22 Apr 2008 19:52:37 -0000 1.89
@@ -838,13 +838,22 @@
(or (eval (cdr (assq major-mode default-directory-alist)))
default-directory))
-(defun dired-smart-shell-command (cmd &optional insert)
+(defun dired-smart-shell-command (command &optional output-buffer error-buffer)
"Like function `shell-command', but in the current Virtual Dired directory."
- (interactive (list (read-from-minibuffer "Shell command: "
- nil nil nil 'shell-command-history)
- current-prefix-arg))
+ (interactive
+ (list
+ (minibuffer-with-setup-hook
+ (lambda ()
+ (set (make-local-variable 'minibuffer-default-add-function)
+ 'minibuffer-default-add-shell-commands))
+ (read-shell-command "Shell command: " nil nil
+ (cond
+ (buffer-file-name (file-relative-name
buffer-file-name))
+ ((eq major-mode 'dired-mode) (dired-get-filename t
t)))))
+ current-prefix-arg
+ shell-command-default-error-buffer))
(let ((default-directory (dired-default-directory)))
- (shell-command cmd insert)))
+ (shell-command command output-buffer error-buffer)))
;;; LOCAL VARIABLES FOR DIRED BUFFERS.