aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/mail/rmail.el23
1 files changed, 15 insertions, 8 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 9c2f516c4e6..078d48b72f7 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -2181,7 +2181,7 @@ or forward if N is negative."
2181(defun rmail-message-recipients-p (msg recipients &optional primary-only) 2181(defun rmail-message-recipients-p (msg recipients &optional primary-only)
2182 (save-restriction 2182 (save-restriction
2183 (goto-char (rmail-msgbeg msg)) 2183 (goto-char (rmail-msgbeg msg))
2184 (search-forward "\n*** EOOH ***\n" (point-max) t) 2184 (search-forward "\n*** EOOH ***\n")
2185 (narrow-to-region (point) (progn (search-forward "\n\n") (point))) 2185 (narrow-to-region (point) (progn (search-forward "\n\n") (point)))
2186 (or (string-match recipients (or (mail-fetch-field "To") "")) 2186 (or (string-match recipients (or (mail-fetch-field "To") ""))
2187 (string-match recipients (or (mail-fetch-field "From") "")) 2187 (string-match recipients (or (mail-fetch-field "From") ""))
@@ -2190,13 +2190,20 @@ or forward if N is negative."
2190 2190
2191(defun rmail-message-regexp-p (msg regexp) 2191(defun rmail-message-regexp-p (msg regexp)
2192 "Return t, if for message number MSG, regexp REGEXP matches in the header." 2192 "Return t, if for message number MSG, regexp REGEXP matches in the header."
2193 (goto-char (rmail-msgbeg msg)) 2193 (save-excursion
2194 (let ((end 2194 (goto-char (rmail-msgbeg msg))
2195 (save-excursion 2195 (let (beg end)
2196 (or (search-forward "\n*** EOOH ***\n" (point-max) t) 2196 (save-excursion
2197 (search-forward "\n\n" (point-max))) 2197 (forward-line 2)
2198 (point)))) 2198 (setq beg (point)))
2199 (re-search-forward regexp end t))) 2199 (save-excursion
2200 (search-forward "\n*** EOOH ***\n" (point-max))
2201 (when (= beg (match-beginning 0))
2202 (setq beg (point))
2203 (search-forward "\n\n" (point-max)))
2204 (setq end (point)))
2205 (goto-char beg)
2206 (re-search-forward regexp end t))))
2200 2207
2201(defvar rmail-search-last-regexp nil) 2208(defvar rmail-search-last-regexp nil)
2202(defun rmail-search (regexp &optional n) 2209(defun rmail-search (regexp &optional n)