aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-09-07 04:43:10 +0000
committerRichard M. Stallman1997-09-07 04:43:10 +0000
commit8ad97b87ee123a4185ae0413617022df1c809635 (patch)
treec227f68152e9129be846c0fa158783524cfd7c66
parent09efee6cc7cb8aa4a08a50f1648c5703e38cb8ef (diff)
downloademacs-8ad97b87ee123a4185ae0413617022df1c809635.tar.gz
emacs-8ad97b87ee123a4185ae0413617022df1c809635.zip
(menu-bar-options-menu): Simplify global-font-lock-mode
entry using enhanced global-font-lock-mode function.
-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."
402(define-key menu-bar-options-menu [auto-fill-mode] 402(define-key menu-bar-options-menu [auto-fill-mode]
403 '("Toggle Auto Fill (word wrap) in Text modes" 403 '("Toggle Auto Fill (word wrap) in Text modes"
404 . toggle-text-mode-auto-fill)) 404 . toggle-text-mode-auto-fill))
405(define-key menu-bar-options-menu [font-lock-mode] 405(define-key menu-bar-options-menu [toggle-global-lazy-font-lock-mode]
406 (menu-bar-make-toggle toggle-font-lock-mode font-lock-mode 406 (menu-bar-make-toggle toggle-global-lazy-font-lock-mode nil
407 "Toggle Font Lock (syntax highlighting)" 407 "Toggle Global Font Lock (highlights syntax)"
408 "Font Lock mode %s" 408 "Global Font Lock mode %s"
409 ;; Make sure a support mode is used;
410 ;; otherwise Font Lock will be too slow.
409 (require 'font-lock) 411 (require 'font-lock)
410 (if global-font-lock-mode 412 (if (not global-font-lock-mode)
411 (let ((buffers (buffer-list))) 413 (or font-lock-support-mode
412 (while buffers 414 (setq font-lock-support-mode 'lazy-lock-mode)))
413 (with-current-buffer (car buffers) 415 (global-font-lock-mode)))
414 (if font-lock-mode
415 (font-lock-mode 0)))
416 (setq buffers (cdr buffers)))
417 (setq global-font-lock-mode nil))
418 (setq font-lock-support-mode 'lazy-lock-mode)
419 (global-font-lock-mode))
420 global-font-lock-mode))
421 416
422(define-key menu-bar-help-menu [emacs-version] 417(define-key menu-bar-help-menu [emacs-version]
423 '("Show Version" . emacs-version)) 418 '("Show Version" . emacs-version))