summaryrefslogtreecommitdiff
path: root/lisp/menu-bar.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-09-07 04:43:10 +0000
committerRichard M. Stallman <rms@gnu.org>1997-09-07 04:43:10 +0000
commit45f322af97f4c56a441fe5f49c16e4cc261ad650 (patch)
treeba542e7f80d184225f314f70f69bbbe4717f9a48 /lisp/menu-bar.el
parent2ec5143f2cec6449aafb80b39cc65f3296dc654a (diff)
downloademacs-45f322af97f4c56a441fe5f49c16e4cc261ad650.tar.gz
(menu-bar-options-menu): Simplify global-font-lock-mode
entry using enhanced global-font-lock-mode function.
Diffstat (limited to 'lisp/menu-bar.el')
-rw-r--r--lisp/menu-bar.el25
1 files changed, 10 insertions, 15 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 46b2c973a79..52ed14f4b32 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -402,22 +402,17 @@ Do the same for the keys of the same name."
(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))