Mercurial > emacs
comparison lisp/mail/rmailout.el @ 145:1a0f15a66c06
*** empty log message ***
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 24 Dec 1990 22:05:55 +0000 |
parents | 714e88ef93c8 |
children | ae5ace097df2 |
comparison
equal
deleted
inserted
replaced
144:535ec1aa78ef | 145:1a0f15a66c06 |
---|---|
20 | 20 |
21 ;; Temporary until Emacs always has this variable. | 21 ;; Temporary until Emacs always has this variable. |
22 (defvar rmail-delete-after-output nil | 22 (defvar rmail-delete-after-output nil |
23 "*Non-nil means automatically delete a message that is copied to a file.") | 23 "*Non-nil means automatically delete a message that is copied to a file.") |
24 | 24 |
25 (defvar rmail-output-file-alist nil | |
26 "*Alist matching regexps to suggested output Rmail files. | |
27 This is a list of elements of the form (REGEXP . FILENAME).") | |
28 | |
25 (defun rmail-output-to-rmail-file (count file-name) | 29 (defun rmail-output-to-rmail-file (count file-name) |
26 "Append the current message to an Rmail file named FILE-NAME. | 30 "Append the current message to an Rmail file named FILE-NAME. |
27 If the file does not exist, ask if it should be created. | 31 If the file does not exist, ask if it should be created. |
28 If file is being visited, the message is appended to the Emacs | 32 If file is being visited, the message is appended to the Emacs |
29 buffer visiting that file. | 33 buffer visiting that file. |
33 (read-file-name | 37 (read-file-name |
34 (concat "Output message to Rmail file: (default " | 38 (concat "Output message to Rmail file: (default " |
35 (file-name-nondirectory rmail-last-rmail-file) | 39 (file-name-nondirectory rmail-last-rmail-file) |
36 ") ") | 40 ") ") |
37 (file-name-directory rmail-last-rmail-file) | 41 (file-name-directory rmail-last-rmail-file) |
38 rmail-last-rmail-file))) | 42 (let (answer tail) |
43 (setq tail rmail-output-file-alist) | |
44 ;; Suggest a file based on a pattern match. | |
45 (while (and tail (not answer)) | |
46 (save-excursion | |
47 (goto-char (point-min)) | |
48 (if (re-search-forward (car (car tail)) nil t) | |
49 (setq answer (cdr (car tail)))) | |
50 (setq tail (cdr tail)))) | |
51 ;; If not suggestions, use same file as last time. | |
52 (or answer rmail-last-rmail-file))))) | |
39 (setq file-name (expand-file-name file-name)) | 53 (setq file-name (expand-file-name file-name)) |
40 (setq rmail-last-rmail-file file-name) | 54 (setq rmail-last-rmail-file file-name) |
41 (rmail-maybe-set-message-counters) | 55 (rmail-maybe-set-message-counters) |
42 (or (get-file-buffer file-name) | 56 (or (get-file-buffer file-name) |
43 (file-exists-p file-name) | 57 (file-exists-p file-name) |