Mercurial > emacs
comparison lisp/mail/rmail.el @ 37494:3da588b28890
(rmail-message-regexp-p): Use rfc822-goto-eoh
if necessary, like in rmail-show-message.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Thu, 26 Apr 2001 13:42:52 +0000 |
parents | 7c77da3d3841 |
children | 797a4ab5dbed |
comparison
equal
deleted
inserted
replaced
37493:36a6344d04e3 | 37494:3da588b28890 |
---|---|
2493 (or (string-match recipients (or (mail-fetch-field "To") "")) | 2493 (or (string-match recipients (or (mail-fetch-field "To") "")) |
2494 (string-match recipients (or (mail-fetch-field "From") "")) | 2494 (string-match recipients (or (mail-fetch-field "From") "")) |
2495 (if (not primary-only) | 2495 (if (not primary-only) |
2496 (string-match recipients (or (mail-fetch-field "Cc") "")))))) | 2496 (string-match recipients (or (mail-fetch-field "Cc") "")))))) |
2497 | 2497 |
2498 (defun rmail-message-regexp-p (msg regexp) | 2498 (defun rmail-message-regexp-p (n regexp) |
2499 "Return t, if for message number MSG, regexp REGEXP matches in the header." | 2499 "Return t, if for message number N, regexp REGEXP matches in the header." |
2500 (save-excursion | 2500 (let ((beg (rmail-msgbeg n)) |
2501 (goto-char (rmail-msgbeg msg)) | 2501 (end (rmail-msgend n))) |
2502 (let (beg end) | 2502 (goto-char beg) |
2503 (save-excursion | 2503 (forward-line 1) |
2504 (forward-line 2) | 2504 (save-excursion |
2505 (setq beg (point))) | 2505 (save-restriction |
2506 (save-excursion | 2506 (if (prog1 (= (following-char) ?0) |
2507 (search-forward "\n*** EOOH ***\n" (point-max)) | 2507 (forward-line 2) |
2508 (when (= beg (match-beginning 0)) | 2508 ;; If there's a Summary-line in the (otherwise empty) |
2509 (setq beg (point)) | 2509 ;; header, we didn't yet get past the EOOH line. |
2510 (search-forward "\n\n" (point-max))) | 2510 (if (looking-at "^\\*\\*\\* EOOH \\*\\*\\*\n") |
2511 (setq end (point))) | 2511 (forward-line 1)) |
2512 (goto-char beg) | 2512 (narrow-to-region (point) end)) |
2513 (re-search-forward regexp end t)))) | 2513 (rfc822-goto-eoh) |
2514 (search-forward "\n*** EOOH ***\n" end t)) | |
2515 (narrow-to-region beg (point)) | |
2516 (goto-char (point-min)) | |
2517 (re-search-forward regexp end t))))) | |
2514 | 2518 |
2515 (defvar rmail-search-last-regexp nil) | 2519 (defvar rmail-search-last-regexp nil) |
2516 (defun rmail-search (regexp &optional n) | 2520 (defun rmail-search (regexp &optional n) |
2517 "Show message containing next match for REGEXP (but not the current msg). | 2521 "Show message containing next match for REGEXP (but not the current msg). |
2518 Prefix argument gives repeat count; negative argument means search | 2522 Prefix argument gives repeat count; negative argument means search |