From: Glenn Morris Date: Fri, 13 Sep 2013 17:28:34 +0000 (-0400) Subject: * lisp/dired-x.el (dired-guess-default): Make `file' available in the env. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1632 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d3fc65499a4bf85799eee7996128cd74fea17cce;p=emacs.git * lisp/dired-x.el (dired-guess-default): Make `file' available in the env. (dired-guess-shell-alist-user): Doc fix. Fixes: debbugs:15363 --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aa17b9328c4..ba3de9f4305 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-09-13 Glenn Morris + + * dired-x.el (dired-guess-shell-alist-user): Doc fix. + (dired-guess-default): Make `file' available in the env. (Bug#15363) + 2013-09-13 Dmitry Antipov * frame.el (x-focus-frame): Mark as declared in frame.c. diff --git a/lisp/dired-x.el b/lisp/dired-x.el index c15f3b5b121..287934f7adc 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -1047,7 +1047,8 @@ Each element of this list looks like (REGEXP COMMAND...) where each COMMAND can either be a string or a Lisp expression that evaluates -to a string. If several COMMANDs are given, the first one will be the default +to a string. This expression can access the file name as the variable `file'. +If several COMMANDs are given, the first one will be the default and the rest will be added temporarily to the history and can be retrieved with \\[previous-history-element] (M-p) . @@ -1105,8 +1106,8 @@ See `dired-guess-shell-alist-user'." ;; Return commands or nil if flist is still non-nil. ;; Evaluate the commands in order that any logical testing will be done. (if (cdr cmds) - (delete-dups (mapcar #'eval cmds)) - (eval (car cmds))))) ; single command + (delete-dups (mapcar (lambda (cmd) (eval cmd `((file . ,file)))) cmds)) + (eval (car cmds) `((file . ,file)))))) ; single command (defun dired-guess-shell-command (prompt files) "Ask user with PROMPT for a shell command, guessing a default from FILES."