diff options
| author | Miles Bader | 2000-10-03 17:35:47 +0000 |
|---|---|---|
| committer | Miles Bader | 2000-10-03 17:35:47 +0000 |
| commit | 64666d2d52aba0f490fd71db9aba7c8c2b495628 (patch) | |
| tree | 985049000de0dcf45833175c36fec89bc48d6a51 | |
| parent | 8dc3ba7d01dc99b9be1de4b8989950199c45fe70 (diff) | |
| download | emacs-64666d2d52aba0f490fd71db9aba7c8c2b495628.tar.gz emacs-64666d2d52aba0f490fd71db9aba7c8c2b495628.zip | |
(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.
| -rw-r--r-- | lisp/dired-aux.el | 10 |
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, | |||
| 1231 | (dired-mark-read-file-name | 1231 | (dired-mark-read-file-name |
| 1232 | (concat (if dired-one-file op1 operation) " %s to: ") | 1232 | (concat (if dired-one-file op1 operation) " %s to: ") |
| 1233 | (dired-dwim-target-directory) | 1233 | (dired-dwim-target-directory) |
| 1234 | op-symbol arg rfn-list))) | 1234 | op-symbol arg rfn-list |
| 1235 | (and dired-one-file (car fn-list))))) | ||
| 1235 | (into-dir (cond ((null how-to) | 1236 | (into-dir (cond ((null how-to) |
| 1236 | ;; Allow DOS/Windows users to change the letter | 1237 | ;; Allow DOS/Windows users to change the letter |
| 1237 | ;; case of a directory. If we don't test these | 1238 | ;; 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, | |||
| 1276 | ;; marks (ARG=nil) or a repeat factor (integerp ARG). | 1277 | ;; marks (ARG=nil) or a repeat factor (integerp ARG). |
| 1277 | ;; If the current file was used, the list has but one element and ARG | 1278 | ;; If the current file was used, the list has but one element and ARG |
| 1278 | ;; does not matter. (It is non-nil, non-integer in that case, namely '(4)). | 1279 | ;; does not matter. (It is non-nil, non-integer in that case, namely '(4)). |
| 1280 | ;; DEFAULT is the default value to return if the user just hits RET; | ||
| 1281 | ;; if it is omitted or nil, then the name of the directory is used. | ||
| 1279 | 1282 | ||
| 1280 | (defun dired-mark-read-file-name (prompt dir op-symbol arg files) | 1283 | (defun dired-mark-read-file-name (prompt dir op-symbol arg files |
| 1284 | &optional default) | ||
| 1281 | (dired-mark-pop-up | 1285 | (dired-mark-pop-up |
| 1282 | nil op-symbol files | 1286 | nil op-symbol files |
| 1283 | (function read-file-name) | 1287 | (function read-file-name) |
| 1284 | (format prompt (dired-mark-prompt arg files)) dir)) | 1288 | (format prompt (dired-mark-prompt arg files)) dir default)) |
| 1285 | 1289 | ||
| 1286 | (defun dired-dwim-target-directory () | 1290 | (defun dired-dwim-target-directory () |
| 1287 | ;; Try to guess which target directory the user may want. | 1291 | ;; Try to guess which target directory the user may want. |