Mercurial > emacs
comparison lisp/mail/rmail.el @ 7061:9f27a57b7662
(rmail-show-message): Use overlays, not text properties.
(rmail-overlay-list): New variable.
(rmail-mode): Make it local.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 24 Apr 1994 05:10:51 +0000 |
parents | 1733b6c1e30b |
children | 0e391644f3ed |
comparison
equal
deleted
inserted
replaced
7060:58d613f69b39 | 7061:9f27a57b7662 |
---|---|
122 | 122 |
123 (defvar rmail-current-message nil) | 123 (defvar rmail-current-message nil) |
124 (defvar rmail-total-messages nil) | 124 (defvar rmail-total-messages nil) |
125 (defvar rmail-message-vector nil) | 125 (defvar rmail-message-vector nil) |
126 (defvar rmail-deleted-vector nil) | 126 (defvar rmail-deleted-vector nil) |
127 | |
128 (defvar rmail-overlay-list nil) | |
127 | 129 |
128 ;; These are used by autoloaded rmail-summary. | 130 ;; These are used by autoloaded rmail-summary. |
129 | 131 |
130 (defvar rmail-summary-buffer nil) | 132 (defvar rmail-summary-buffer nil) |
131 (defvar rmail-summary-vector nil) | 133 (defvar rmail-summary-vector nil) |
573 (make-local-variable 'rmail-summary-vector) | 575 (make-local-variable 'rmail-summary-vector) |
574 (make-local-variable 'rmail-current-message) | 576 (make-local-variable 'rmail-current-message) |
575 (make-local-variable 'rmail-total-messages) | 577 (make-local-variable 'rmail-total-messages) |
576 (make-local-variable 'require-final-newline) | 578 (make-local-variable 'require-final-newline) |
577 (setq require-final-newline nil) | 579 (setq require-final-newline nil) |
580 (make-local-variable 'rmail-overlay-list) | |
581 (setq rmail-overlay-list nil) | |
578 (make-local-variable 'version-control) | 582 (make-local-variable 'version-control) |
579 (setq version-control 'never) | 583 (setq version-control 'never) |
580 (make-local-variable 'file-precious-flag) | 584 (make-local-variable 'file-precious-flag) |
581 (setq file-precious-flag t) | 585 (setq file-precious-flag t) |
582 (make-local-variable 'rmail-message-vector) | 586 (make-local-variable 'rmail-message-vector) |
1401 (let ((case-fold-search t) | 1405 (let ((case-fold-search t) |
1402 (inhibit-read-only t) | 1406 (inhibit-read-only t) |
1403 ;; Highlight with boldface if that is available. | 1407 ;; Highlight with boldface if that is available. |
1404 ;; Otherwise use the `highlight' face. | 1408 ;; Otherwise use the `highlight' face. |
1405 (face (if (face-differs-from-default-p 'bold) | 1409 (face (if (face-differs-from-default-p 'bold) |
1406 'bold 'highlight))) | 1410 'bold 'highlight)) |
1411 ;; List of overlays to reuse. | |
1412 (overlays rmail-overlay-list)) | |
1407 (goto-char (point-min)) | 1413 (goto-char (point-min)) |
1408 (while (re-search-forward rmail-highlighted-headers nil t) | 1414 (while (re-search-forward rmail-highlighted-headers nil t) |
1409 (skip-syntax-forward " ") | 1415 (skip-syntax-forward " ") |
1410 (let ((beg (point))) | 1416 (let ((beg (point)) |
1417 overlay) | |
1411 (while (progn (forward-line 1) | 1418 (while (progn (forward-line 1) |
1412 (looking-at "[ \t]"))) | 1419 (looking-at "[ \t]"))) |
1413 ;; Back up over newline, then trailing spaces or tabs | 1420 ;; Back up over newline, then trailing spaces or tabs |
1414 (forward-char -1) | 1421 (forward-char -1) |
1415 (while (member (preceding-char) '(? ?\t)) | 1422 (while (member (preceding-char) '(? ?\t)) |
1416 (forward-char -1)) | 1423 (forward-char -1)) |
1417 (put-text-property beg (point) 'face face)))))) | 1424 (if overlays |
1425 ;; Reuse an overlay we already have. | |
1426 (progn | |
1427 (setq overlay (car overlays) | |
1428 overlays (cdr overlays)) | |
1429 (move-overlay overlay beg (point))) | |
1430 ;; Make a new overlay and add it to | |
1431 ;; rmail-overlay-list. | |
1432 (setq overlay (make-overlay beg beg)) | |
1433 (overlay-put overlay 'face face) | |
1434 (setq rmail-overlay-list | |
1435 (cons overlay rmail-overlay-list)))))))) | |
1418 (run-hooks 'rmail-show-message-hook) | 1436 (run-hooks 'rmail-show-message-hook) |
1419 ;; If there is a summary buffer, try to move to this message | 1437 ;; If there is a summary buffer, try to move to this message |
1420 ;; in that buffer. But don't complain if this message | 1438 ;; in that buffer. But don't complain if this message |
1421 ;; is not mentioned in the summary. | 1439 ;; is not mentioned in the summary. |
1422 (if (rmail-summary-exists) | 1440 (if (rmail-summary-exists) |