Commit 7cef3569 authored by Glenn Morris's avatar Glenn Morris
Browse files

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).
parent 450809af
2012-08-19 Glenn Morris <rgm@gnu.org>
* mail/rmailout.el (rmail-output-read-file-name):
Fix previous change (when the alist is nil or does not match).
2012-08-19 Chong Yidong <cyd@gnu.org>
 
* xml.el (xml-escape-string): Don't refer to xml-entity-alist
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment