diff options
| author | Simon Marshall | 1996-01-26 08:26:58 +0000 |
|---|---|---|
| committer | Simon Marshall | 1996-01-26 08:26:58 +0000 |
| commit | 271c888a358af617b3ac79e9034c0bebbda2f64d (patch) | |
| tree | f09b3494e7a43d58200397662c60617d774b1d81 /lisp/mail | |
| parent | 26adca1bd9c38f8088dcdcba608cb5ca193384d0 (diff) | |
| download | emacs-271c888a358af617b3ac79e9034c0bebbda2f64d.tar.gz emacs-271c888a358af617b3ac79e9034c0bebbda2f64d.zip | |
Support for local fontification.
Diffstat (limited to 'lisp/mail')
| -rw-r--r-- | lisp/mail/rmail.el | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 31be2304bb0..961a94e5276 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -647,7 +647,10 @@ Instead, these commands are available: | |||
| 647 | (defun rmail-variables () | 647 | (defun rmail-variables () |
| 648 | (make-local-variable 'revert-buffer-function) | 648 | (make-local-variable 'revert-buffer-function) |
| 649 | (setq revert-buffer-function 'rmail-revert) | 649 | (setq revert-buffer-function 'rmail-revert) |
| 650 | (make-local-variable 'font-lock-defaults) | 650 | (setq font-lock-defaults |
| 651 | '(rmail-font-lock-keywords t nil nil nil | ||
| 652 | (rmail-fontify-buffer-function rmail-unfontify-buffer-function nil nil | ||
| 653 | (fast-lock-mode)))) | ||
| 651 | (setq font-lock-defaults '(rmail-font-lock-keywords t)) | 654 | (setq font-lock-defaults '(rmail-font-lock-keywords t)) |
| 652 | (make-local-variable 'rmail-last-label) | 655 | (make-local-variable 'rmail-last-label) |
| 653 | (make-local-variable 'rmail-last-regexp) | 656 | (make-local-variable 'rmail-last-regexp) |
| @@ -2525,6 +2528,34 @@ This has an effect only if a summary buffer exists.") | |||
| 2525 | (window-height)))) | 2528 | (window-height)))) |
| 2526 | (select-window selected))))) | 2529 | (select-window selected))))) |
| 2527 | 2530 | ||
| 2531 | ;;;; *** Rmail Local Fontification *** | ||
| 2532 | |||
| 2533 | (defun rmail-fontify-buffer-function () | ||
| 2534 | ;; This function's symbol is bound to font-lock-fontify-buffer-function. | ||
| 2535 | (if (and (boundp 'lazy-lock-mode) lazy-lock-mode) | ||
| 2536 | (setq font-lock-fontify-buffer-function | ||
| 2537 | 'font-lock-default-fontify-buffer) | ||
| 2538 | (make-local-hook 'rmail-show-message-hook) | ||
| 2539 | (add-hook 'rmail-show-message-hook 'rmail-fontify-message nil t) | ||
| 2540 | (rmail-fontify-message))) | ||
| 2541 | |||
| 2542 | (defun rmail-unfontify-buffer-function () | ||
| 2543 | ;; This function's symbol is bound to font-lock-fontify-unbuffer-function. | ||
| 2544 | (remove-hook 'rmail-show-message-hook 'rmail-fontify-message t) | ||
| 2545 | (font-lock-default-unfontify-buffer)) | ||
| 2546 | |||
| 2547 | (defun rmail-fontify-message () | ||
| 2548 | ;; Fontify the current message if it is not already fontified. | ||
| 2549 | (if (text-property-any (point-min) (point-max) 'rmail-fontified nil) | ||
| 2550 | (let ((modified (buffer-modified-p)) | ||
| 2551 | (buffer-undo-list t) (inhibit-read-only t) | ||
| 2552 | before-change-functions after-change-functions | ||
| 2553 | buffer-file-name buffer-file-truename) | ||
| 2554 | (save-excursion | ||
| 2555 | (save-match-data | ||
| 2556 | (add-text-properties (point-min) (point-max) '(rmail-fontified t)) | ||
| 2557 | (font-lock-fontify-region (point-min) (point-max))))))) | ||
| 2558 | |||
| 2528 | ;;;; *** Rmail Specify Inbox Files *** | 2559 | ;;;; *** Rmail Specify Inbox Files *** |
| 2529 | 2560 | ||
| 2530 | (autoload 'set-rmail-inbox-list "rmailmsc" | 2561 | (autoload 'set-rmail-inbox-list "rmailmsc" |