summaryrefslogtreecommitdiff
path: root/lisp/mail/rmailout.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2012-08-19 11:41:35 -0700
committerGlenn Morris <rgm@gnu.org>2012-08-19 11:41:35 -0700
commit7cef3569a3d872ea5be07a529b68910bf1d8b790 (patch)
treed9da609d77f849d402518955647cf0592cc8b6c2 /lisp/mail/rmailout.el
parent450809af98c857e5161aa28f31871e52a22dacad (diff)
downloademacs-7cef3569a3d872ea5be07a529b68910bf1d8b790.tar.gz
Fix previous rmail-output-read-file-name change
* lisp/mail/rmailout.el (rmail-output-read-file-name): Fix previous change (when the alist is nil or does not match).
Diffstat (limited to 'lisp/mail/rmailout.el')
-rw-r--r--lisp/mail/rmailout.el45
1 files changed, 24 insertions, 21 deletions
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index 5d500135b7a..c325824eb28 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -61,27 +61,30 @@ The function `rmail-delete-unwanted-fields' uses this, ignoring case."
Set `rmail-default-file' to this name as well as returning it.
This uses `rmail-output-file-alist'."
(let* ((default-file
- (when rmail-output-file-alist
- (or rmail-buffer (error "There is no Rmail buffer"))
- (save-current-buffer
- (set-buffer rmail-buffer)
- (let ((beg (rmail-msgbeg rmail-current-message))
- (end (rmail-msgend rmail-current-message)))
- (if (rmail-buffers-swapped-p) (set-buffer rmail-view-buffer))
- (save-excursion
- (save-restriction
- (widen)
- (narrow-to-region beg end)
- (let ((tail rmail-output-file-alist)
- answer)
- ;; Suggest a file based on a pattern match.
- (while (and tail (not answer))
- (goto-char (point-min))
- (if (re-search-forward (caar tail) nil t)
- (setq answer (eval (cdar tail))))
- (setq tail (cdr tail)))
- ;; If no suggestion, use same file as last time.
- (or answer rmail-default-file))))))))
+ (or
+ (when rmail-output-file-alist
+ (or rmail-buffer (error "There is no Rmail buffer"))
+ (save-current-buffer
+ (set-buffer rmail-buffer)
+ (let ((beg (rmail-msgbeg rmail-current-message))
+ (end (rmail-msgend rmail-current-message)))
+ (if (rmail-buffers-swapped-p) (set-buffer rmail-view-buffer))
+ (save-excursion
+ (save-restriction
+ (widen)
+ (narrow-to-region beg end)
+ (let ((tail rmail-output-file-alist)
+ answer)
+ ;; Suggest a file based on a pattern match.
+ (while (and tail (not answer))
+ (goto-char (point-min))
+ (if (re-search-forward (caar tail) nil t)
+ ;; FIXME trap and report any errors.
+ (setq answer (eval (cdar tail))))
+ (setq tail (cdr tail)))
+ answer))))))
+ ;; If no suggestion, use same file as last time.
+ rmail-default-file))
(read-file
(expand-file-name
(read-file-name