(rmail-message-recipients-p-1, rmail-message-regexp-p-1): Avoid clobbering the mark.

This commit is contained in:
Chong Yidong 2009-01-27 03:15:52 +00:00
parent 6682b72d72
commit 3fbc055fd8

View file

@ -113,7 +113,7 @@ RECIPIENTS is a string of regexps separated by commas."
recipients primary-only))
(defun rmail-message-recipients-p-1 (recipients &optional primary-only)
(narrow-to-region (point) (progn (search-forward "\n\n") (point)))
(narrow-to-region (point) (save-excursion (search-forward "\n\n") (point)))
(or (string-match recipients (or (mail-fetch-field "To") ""))
(string-match recipients (or (mail-fetch-field "From") ""))
(if (not primary-only)
@ -140,7 +140,7 @@ Emacs will list the header line in the RMAIL-summary."
(rmail-apply-in-message msg 'rmail-message-regexp-p-1 msg regexp))
(defun rmail-message-regexp-p-1 (msg regexp)
(narrow-to-region (point) (progn (search-forward "\n\n") (point)))
(narrow-to-region (point) (save-excursion (search-forward "\n\n") (point)))
(if rmail-enable-mime
(funcall rmail-search-mime-header-function msg regexp (point))
(re-search-forward regexp nil t)))