aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1996-06-17 00:06:46 +0000
committerRichard M. Stallman1996-06-17 00:06:46 +0000
commit6c0fc42885a344c35482f402f849a008b960c2ad (patch)
treebf0475d314daeb4789d44c961241646a94516932 /lisp
parenta013d266d17c2bc9d22de5f050de985bb7207e59 (diff)
downloademacs-6c0fc42885a344c35482f402f849a008b960c2ad.tar.gz
emacs-6c0fc42885a344c35482f402f849a008b960c2ad.zip
(global-font-lock-mode): Set up find-file-hooks.
(font-lock-default-fontify-buffer, font-lock-fontify-block) (font-lock-mode): Fix syntax of msgs such as Fontifying...done.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/font-lock.el9
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 33ba04dc41a..388efef6d6c 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -457,7 +457,7 @@ syntactic change on other lines, you can use \\[font-lock-fontify-block]."
457 'font-lock-fontify-buffer-function)))) 457 'font-lock-fontify-buffer-function))))
458 (font-lock-fontify-buffer)) 458 (font-lock-fontify-buffer))
459 (font-lock-verbose 459 (font-lock-verbose
460 (message "Fontifying %s... buffer too big." (buffer-name))))) 460 (message "Fontifying %s...buffer too big" (buffer-name)))))
461 (font-lock-fontified 461 (font-lock-fontified
462 (font-lock-unfontify-buffer) 462 (font-lock-unfontify-buffer)
463 (remove-hook 'before-revert-hook 'font-lock-revert-setup t) 463 (remove-hook 'before-revert-hook 'font-lock-revert-setup t)
@@ -546,6 +546,9 @@ turned on in a buffer if its major mode is one of `font-lock-global-modes'."
546 (remove-hook 'change-major-mode-hook 'font-lock-change-major-mode) 546 (remove-hook 'change-major-mode-hook 'font-lock-change-major-mode)
547 (add-hook 'change-major-mode-hook 'font-lock-change-major-mode) 547 (add-hook 'change-major-mode-hook 'font-lock-change-major-mode)
548 (add-hook 'post-command-hook 'turn-on-font-lock-if-enabled) 548 (add-hook 'post-command-hook 'turn-on-font-lock-if-enabled)
549 ;; This is to make sure we fontify immediately
550 ;; when process filters (such as GUD) find files.
551 (add-hook 'find-file-hooks 'turn-on-font-lock-if-enabled)
549 (setq font-lock-buffers (buffer-list))) 552 (setq font-lock-buffers (buffer-list)))
550 (if message 553 (if message
551 (message "Global Font Lock mode is now %s." (if off-p "OFF" "ON"))) 554 (message "Global Font Lock mode is now %s." (if off-p "OFF" "ON")))
@@ -611,7 +614,7 @@ turned on in a buffer if its major mode is one of `font-lock-global-modes'."
611 (setq font-lock-fontified t))) 614 (setq font-lock-fontified t)))
612 ;; We don't restore the old fontification, so it's best to unfontify. 615 ;; We don't restore the old fontification, so it's best to unfontify.
613 (quit (font-lock-unfontify-buffer)))) 616 (quit (font-lock-unfontify-buffer))))
614 (if verbose (message "Fontifying %s... %s." (buffer-name) 617 (if verbose (message "Fontifying %s...%s" (buffer-name)
615 (if font-lock-fontified "done" "aborted"))))) 618 (if font-lock-fontified "done" "aborted")))))
616 619
617(defun font-lock-default-unfontify-buffer () 620(defun font-lock-default-unfontify-buffer ()
@@ -690,7 +693,7 @@ delimit the region to fontify."
690 (save-excursion (forward-line lines) (point)))) 693 (save-excursion (forward-line lines) (point))))
691 (funcall font-lock-mark-block-function) 694 (funcall font-lock-mark-block-function)
692 (font-lock-fontify-region (point) (mark))) 695 (font-lock-fontify-region (point) (mark)))
693 ((error quit) (message "Fontifying block... %s" error-data))))))) 696 ((error quit) (message "Fontifying block...%s" error-data)))))))
694 697
695(define-key facemenu-keymap "\M-g" 'font-lock-fontify-block) 698(define-key facemenu-keymap "\M-g" 'font-lock-fontify-block)
696 699