summaryrefslogtreecommitdiff
path: root/lisp/dired-aux.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2000-10-03 17:35:47 +0000
committerMiles Bader <miles@gnu.org>2000-10-03 17:35:47 +0000
commit64666d2d52aba0f490fd71db9aba7c8c2b495628 (patch)
tree985049000de0dcf45833175c36fec89bc48d6a51 /lisp/dired-aux.el
parent8dc3ba7d01dc99b9be1de4b8989950199c45fe70 (diff)
downloademacs-64666d2d52aba0f490fd71db9aba7c8c2b495628.tar.gz
(dired-mark-read-file-name): Add optional arg DEFAULT.
(dired-do-create-files): If there's only one file, pass it in as the DEFAULT arg to dired-mark-read-file-name.
Diffstat (limited to 'lisp/dired-aux.el')
-rw-r--r--lisp/dired-aux.el10
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 4a2d8932457..5c38c68ff97 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1231,7 +1231,8 @@ ESC or `q' to not overwrite any of the remaining files,
(dired-mark-read-file-name
(concat (if dired-one-file op1 operation) " %s to: ")
(dired-dwim-target-directory)
- op-symbol arg rfn-list)))
+ op-symbol arg rfn-list
+ (and dired-one-file (car fn-list)))))
(into-dir (cond ((null how-to)
;; Allow DOS/Windows users to change the letter
;; case of a directory. If we don't test these
@@ -1276,12 +1277,15 @@ ESC or `q' to not overwrite any of the remaining files,
;; marks (ARG=nil) or a repeat factor (integerp ARG).
;; If the current file was used, the list has but one element and ARG
;; does not matter. (It is non-nil, non-integer in that case, namely '(4)).
+;; DEFAULT is the default value to return if the user just hits RET;
+;; if it is omitted or nil, then the name of the directory is used.
-(defun dired-mark-read-file-name (prompt dir op-symbol arg files)
+(defun dired-mark-read-file-name (prompt dir op-symbol arg files
+ &optional default)
(dired-mark-pop-up
nil op-symbol files
(function read-file-name)
- (format prompt (dired-mark-prompt arg files)) dir))
+ (format prompt (dired-mark-prompt arg files)) dir default))
(defun dired-dwim-target-directory ()
;; Try to guess which target directory the user may want.