Tell the byte-compiler about dired-get-filename.
(shell-command): In Dired mode, get filename from the current line
as the default value.
** Add function to redraw the tool bar.
-** M-! M-n should fetch the buffer-file-name as the default.
-
** Redesign the load-history data structure so it can cope better
with evaluating definitions of the same function from different files,
recording which file the latest definition came from.
+2009-11-11 Juri Linkov <juri@jurta.org>
+
+ * simple.el (dired-get-filename)<declare-function>:
+ Tell the byte-compiler about dired-get-filename.
+ (shell-command): In Dired mode, get filename from the current line
+ as the default value.
+
2009-11-10 Glenn Morris <rgm@gnu.org>
* dired.el, hi-lock.el, calendar/cal-menu.el, calendar/calendar.el:
stdout will be intermixed in the output stream.")
(declare-function mailcap-file-default-commands "mailcap" (files))
+(declare-function dired-get-filename "dired" (&optional localp no-error-if-not-filep))
(defun minibuffer-default-add-shell-commands ()
"Return a list of all commands associated with the current file.
(interactive
(list
(read-shell-command "Shell command: " nil nil
- (and buffer-file-name
- (file-relative-name buffer-file-name)))
+ (let ((filename
+ (cond
+ (buffer-file-name)
+ ((eq major-mode 'dired-mode)
+ (dired-get-filename nil t)))))
+ (and filename (file-relative-name filename))))
current-prefix-arg
shell-command-default-error-buffer))
;; Look for a handler in case default-directory is a remote file name.