summaryrefslogtreecommitdiff
path: root/lisp/mail/rmailout.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1990-12-24 22:05:55 +0000
committerRichard M. Stallman <rms@gnu.org>1990-12-24 22:05:55 +0000
commit0f91ee7e0170c018b412d1c012590b66e0a579e8 (patch)
tree40560f5b3a82895528b4cd6f1fbf01f999100e5a /lisp/mail/rmailout.el
parent408a4c8f5e5ed1a096dbc774c2318653ab555e6f (diff)
downloademacs-0f91ee7e0170c018b412d1c012590b66e0a579e8.tar.gz
*** empty log message ***
Diffstat (limited to 'lisp/mail/rmailout.el')
-rw-r--r--lisp/mail/rmailout.el16
1 files changed, 15 insertions, 1 deletions
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index 988ba78a114..a02c2260fd3 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -22,6 +22,10 @@
(defvar rmail-delete-after-output nil
"*Non-nil means automatically delete a message that is copied to a file.")
+(defvar rmail-output-file-alist nil
+ "*Alist matching regexps to suggested output Rmail files.
+This is a list of elements of the form (REGEXP . FILENAME).")
+
(defun rmail-output-to-rmail-file (count file-name)
"Append the current message to an Rmail file named FILE-NAME.
If the file does not exist, ask if it should be created.
@@ -35,7 +39,17 @@ starting with the current one. Deleted messages are skipped and don't count."
(file-name-nondirectory rmail-last-rmail-file)
") ")
(file-name-directory rmail-last-rmail-file)
- rmail-last-rmail-file)))
+ (let (answer tail)
+ (setq tail rmail-output-file-alist)
+ ;; Suggest a file based on a pattern match.
+ (while (and tail (not answer))
+ (save-excursion
+ (goto-char (point-min))
+ (if (re-search-forward (car (car tail)) nil t)
+ (setq answer (cdr (car tail))))
+ (setq tail (cdr tail))))
+ ;; If not suggestions, use same file as last time.
+ (or answer rmail-last-rmail-file)))))
(setq file-name (expand-file-name file-name))
(setq rmail-last-rmail-file file-name)
(rmail-maybe-set-message-counters)