aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-06-11 16:36:19 +0000
committerRichard M. Stallman1993-06-11 16:36:19 +0000
commitb25b6c3402ba93ea12fc369585cf9f6de0e09d25 (patch)
tree7946323d127ac85827452f2b5ee862decebfe0d6
parent6bfb79222859ab9f3e5f00dce03581465fbc60ec (diff)
downloademacs-b25b6c3402ba93ea12fc369585cf9f6de0e09d25.tar.gz
emacs-b25b6c3402ba93ea12fc369585cf9f6de0e09d25.zip
(rmail-output-to-rmail-file): Use the smart default in the prompt.
-rw-r--r--lisp/mail/rmailout.el37
1 files changed, 20 insertions, 17 deletions
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index 5bd3808fa46..49aa6c5cd23 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -40,23 +40,26 @@ If file is being visited, the message is appended to the Emacs
40buffer visiting that file. 40buffer visiting that file.
41A prefix argument N says to output N consecutive messages 41A prefix argument N says to output N consecutive messages
42starting with the current one. Deleted messages are skipped and don't count." 42starting with the current one. Deleted messages are skipped and don't count."
43 (interactive (list (read-file-name 43 (interactive
44 (concat "Output message to Rmail file: (default " 44 (let ((default-file
45 (file-name-nondirectory rmail-last-rmail-file) 45 (let (answer tail)
46 ") ") 46 (setq tail rmail-output-file-alist)
47 (file-name-directory rmail-last-rmail-file) 47 ;; Suggest a file based on a pattern match.
48 (let (answer tail) 48 (while (and tail (not answer))
49 (setq tail rmail-output-file-alist) 49 (save-excursion
50 ;; Suggest a file based on a pattern match. 50 (goto-char (point-min))
51 (while (and tail (not answer)) 51 (if (re-search-forward (car (car tail)) nil t)
52 (save-excursion 52 (setq answer (cdr (car tail))))
53 (goto-char (point-min)) 53 (setq tail (cdr tail))))
54 (if (re-search-forward (car (car tail)) nil t) 54 ;; If not suggestions, use same file as last time.
55 (setq answer (cdr (car tail)))) 55 (or answer rmail-last-rmail-file))))
56 (setq tail (cdr tail)))) 56 (list (read-file-name
57 ;; If not suggestions, use same file as last time. 57 (concat "Output message to Rmail file: (default "
58 (or answer rmail-last-rmail-file))) 58 (file-name-nondirectory default-file)
59 (prefix-numeric-value current-prefix-arg))) 59 ") ")
60 (file-name-directory rmail-last-rmail-file)
61 default-file)
62 (prefix-numeric-value current-prefix-arg))))
60 (or count (setq count 1)) 63 (or count (setq count 1))
61 (setq file-name 64 (setq file-name
62 (expand-file-name file-name 65 (expand-file-name file-name