diff options
| author | Richard M. Stallman | 1994-04-23 07:40:25 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-04-23 07:40:25 +0000 |
| commit | 072c3cd228fd4df189dadc5ab9fc2cd56bfaad63 (patch) | |
| tree | 9322da7298188997627153c336b1d1a5a7f10d36 | |
| parent | 9076a6fce111172999ad585a6fdf386d6ffd17eb (diff) | |
| download | emacs-072c3cd228fd4df189dadc5ab9fc2cd56bfaad63.tar.gz emacs-072c3cd228fd4df189dadc5ab9fc2cd56bfaad63.zip | |
(rmail-show-message): Highlight the specified fields.
(rmail-highlighted-headers): New user variable.
| -rw-r--r-- | lisp/mail/rmail.el | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index e991b1d2033..16b11d00caa 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -68,6 +68,10 @@ It is useful to set this variable in the site customization file.") | |||
| 68 | *Regexp to match Header fields that rmail should normally hide.") | 68 | *Regexp to match Header fields that rmail should normally hide.") |
| 69 | 69 | ||
| 70 | ;;;###autoload | 70 | ;;;###autoload |
| 71 | (defvar rmail-highlighted-headers "^From:\\|^Subject:" "\ | ||
| 72 | *Regexp to match Header fields that rmail should normally highlight.") | ||
| 73 | |||
| 74 | ;;;###autoload | ||
| 71 | (defvar rmail-delete-after-output nil "\ | 75 | (defvar rmail-delete-after-output nil "\ |
| 72 | *Non-nil means automatically delete a message that is copied to a file.") | 76 | *Non-nil means automatically delete a message that is copied to a file.") |
| 73 | 77 | ||
| @@ -1389,6 +1393,28 @@ If summary buffer is currently displayed, update current message there also." | |||
| 1389 | (narrow-to-region (point) end)) | 1393 | (narrow-to-region (point) end)) |
| 1390 | (goto-char (point-min)) | 1394 | (goto-char (point-min)) |
| 1391 | (rmail-display-labels) | 1395 | (rmail-display-labels) |
| 1396 | ;; Find all occurrences of certain fields, and highlight them. | ||
| 1397 | (save-excursion | ||
| 1398 | (search-forward "\n\n" nil 'move) | ||
| 1399 | (save-restriction | ||
| 1400 | (narrow-to-region (point-min) (point)) | ||
| 1401 | (let ((case-fold-search t) | ||
| 1402 | (inhibit-read-only t) | ||
| 1403 | ;; Highlight with boldface if that is available. | ||
| 1404 | ;; Otherwise use the `highlight' face. | ||
| 1405 | (face (if (face-differs-from-default-p 'bold) | ||
| 1406 | 'bold 'highlight))) | ||
| 1407 | (goto-char (point-min)) | ||
| 1408 | (while (re-search-forward rmail-highlighted-headers nil t) | ||
| 1409 | (skip-syntax-forward " ") | ||
| 1410 | (let ((beg (point))) | ||
| 1411 | (while (progn (forward-line 1) | ||
| 1412 | (looking-at "[ \t]"))) | ||
| 1413 | ;; Back up over newline, then trailing spaces or tabs | ||
| 1414 | (forward-char -1) | ||
| 1415 | (while (member (preceding-char) '(? ?\t)) | ||
| 1416 | (forward-char -1)) | ||
| 1417 | (put-text-property beg (point) 'face face)))))) | ||
| 1392 | (run-hooks 'rmail-show-message-hook) | 1418 | (run-hooks 'rmail-show-message-hook) |
| 1393 | ;; If there is a summary buffer, try to move to this message | 1419 | ;; If there is a summary buffer, try to move to this message |
| 1394 | ;; in that buffer. But don't complain if this message | 1420 | ;; in that buffer. But don't complain if this message |