changeset 19793:8c5aca90861b

(menu-bar-options-menu): Simplify global-font-lock-mode entry using enhanced global-font-lock-mode function.
author Richard M. Stallman <rms@gnu.org>
date Sun, 07 Sep 1997 04:43:10 +0000
parents 953af2c5a9d1
children 3f3165285c1b
files lisp/menu-bar.el
diffstat 1 files changed, 10 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/menu-bar.el	Sun Sep 07 04:31:35 1997 +0000
+++ b/lisp/menu-bar.el	Sun Sep 07 04:43:10 1997 +0000
@@ -402,22 +402,17 @@
 (define-key menu-bar-options-menu [auto-fill-mode]
   '("Toggle Auto Fill (word wrap) in Text modes"
     . toggle-text-mode-auto-fill))
-(define-key menu-bar-options-menu [font-lock-mode]
-  (menu-bar-make-toggle toggle-font-lock-mode font-lock-mode
-			"Toggle Font Lock (syntax highlighting)"
-			"Font Lock mode %s"
+(define-key menu-bar-options-menu [toggle-global-lazy-font-lock-mode]
+  (menu-bar-make-toggle toggle-global-lazy-font-lock-mode nil
+			"Toggle Global Font Lock (highlights syntax)"
+			"Global Font Lock mode %s"
+			;; Make sure a support mode is used;
+			;; otherwise Font Lock will be too slow.
 			(require 'font-lock)
-			(if global-font-lock-mode
-			    (let ((buffers (buffer-list)))
-			      (while buffers
-				(with-current-buffer (car buffers)
-				  (if font-lock-mode
-				      (font-lock-mode 0)))
-				(setq buffers (cdr buffers)))
-			      (setq global-font-lock-mode nil))
-			  (setq font-lock-support-mode 'lazy-lock-mode)
-			  (global-font-lock-mode))
-			global-font-lock-mode))
+			(if (not global-font-lock-mode)
+			    (or font-lock-support-mode
+				(setq font-lock-support-mode 'lazy-lock-mode)))
+			(global-font-lock-mode)))
 
 (define-key menu-bar-help-menu [emacs-version]
   '("Show Version" . emacs-version))