1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 11:50:51 -08:00

(menu-bar-options-menu): Simplify global-font-lock-mode

entry using enhanced global-font-lock-mode function.
This commit is contained in:
Richard M. Stallman 1997-09-07 04:43:10 +00:00
parent 09efee6cc7
commit 8ad97b87ee

View file

@ -402,22 +402,17 @@ Do the same for the keys of the same name."
(define-key menu-bar-options-menu [auto-fill-mode] (define-key menu-bar-options-menu [auto-fill-mode]
'("Toggle Auto Fill (word wrap) in Text modes" '("Toggle Auto Fill (word wrap) in Text modes"
. toggle-text-mode-auto-fill)) . toggle-text-mode-auto-fill))
(define-key menu-bar-options-menu [font-lock-mode] (define-key menu-bar-options-menu [toggle-global-lazy-font-lock-mode]
(menu-bar-make-toggle toggle-font-lock-mode font-lock-mode (menu-bar-make-toggle toggle-global-lazy-font-lock-mode nil
"Toggle Font Lock (syntax highlighting)" "Toggle Global Font Lock (highlights syntax)"
"Font Lock mode %s" "Global Font Lock mode %s"
;; Make sure a support mode is used;
;; otherwise Font Lock will be too slow.
(require 'font-lock) (require 'font-lock)
(if global-font-lock-mode (if (not global-font-lock-mode)
(let ((buffers (buffer-list))) (or font-lock-support-mode
(while buffers (setq font-lock-support-mode 'lazy-lock-mode)))
(with-current-buffer (car buffers) (global-font-lock-mode)))
(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))
(define-key menu-bar-help-menu [emacs-version] (define-key menu-bar-help-menu [emacs-version]
'("Show Version" . emacs-version)) '("Show Version" . emacs-version))