From b4b87b68dddfb8cb54804765bb5c1e577e14ad8e Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 18 Apr 1998 01:54:05 +0000 Subject: [PATCH] (rmail-message-regexp-p): Handle unreformatted messages for real. (rmail-message-recipients-p): Undo previous change. --- lisp/mail/rmail.el | 23 +++++++++++++++-------- 1 file 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." (defun rmail-message-recipients-p (msg recipients &optional primary-only) (save-restriction (goto-char (rmail-msgbeg msg)) - (search-forward "\n*** EOOH ***\n" (point-max) t) + (search-forward "\n*** EOOH ***\n") (narrow-to-region (point) (progn (search-forward "\n\n") (point))) (or (string-match recipients (or (mail-fetch-field "To") "")) (string-match recipients (or (mail-fetch-field "From") "")) @@ -2190,13 +2190,20 @@ or forward if N is negative." (defun rmail-message-regexp-p (msg regexp) "Return t, if for message number MSG, regexp REGEXP matches in the header." - (goto-char (rmail-msgbeg msg)) - (let ((end - (save-excursion - (or (search-forward "\n*** EOOH ***\n" (point-max) t) - (search-forward "\n\n" (point-max))) - (point)))) - (re-search-forward regexp end t))) + (save-excursion + (goto-char (rmail-msgbeg msg)) + (let (beg end) + (save-excursion + (forward-line 2) + (setq beg (point))) + (save-excursion + (search-forward "\n*** EOOH ***\n" (point-max)) + (when (= beg (match-beginning 0)) + (setq beg (point)) + (search-forward "\n\n" (point-max))) + (setq end (point))) + (goto-char beg) + (re-search-forward regexp end t)))) (defvar rmail-search-last-regexp nil) (defun rmail-search (regexp &optional n) -- 2.39.2