changeset 21302:77a4a1ce8d26

(menu-bar-options-menu): Remove "Toggle" from item names, using buttons instead. (menu-bar-make-toggle): Define a menu-item toggle button. (menu-bar-options-menu [save-place]): (require 'saveplace). (menu-bar-options-menu [toggle-auto-compression], [auto-fill-mode]) (menu-bar-options-menu [toggle-global-lazy-font-lock-mode]): Define a menu-item button.
author Richard M. Stallman <rms@gnu.org>
date Sat, 28 Mar 1998 05:43:01 +0000
parents 129d706946d5
children 346595905ae4
files lisp/menu-bar.el
diffstat 1 files changed, 17 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/menu-bar.el	Fri Mar 27 10:11:45 1998 +0000
+++ b/lisp/menu-bar.el	Sat Mar 28 05:43:01 1998 +0000
@@ -388,24 +388,26 @@
 	      `(setq ,variable (not ,variable)))
 	   (message ,message "enabled")
 	 (message ,message "disabled")))
-     '(,doc . ,name)))
+     '(menu-item ,doc ,name .
+                 (:button (:toggle . (and (boundp ',variable) ,variable))))))
 
 (define-key menu-bar-options-menu [debug-on-quit]
   (menu-bar-make-toggle toggle-debug-on-quit debug-on-quit
-			"Toggle Debug on Quit" "Debug on Quit %s"))
+			"Debug on Quit" "Debug on Quit %s"))
 (define-key menu-bar-options-menu [debug-on-error]
   (menu-bar-make-toggle toggle-debug-on-error debug-on-error
-			"Toggle Debug on Error" "Debug on Error %s"))
+			"Debug on Error" "Debug on Error %s"))
 (define-key menu-bar-options-menu [options-separator]
   '("--"))
 (define-key menu-bar-options-menu [save-place]
   (menu-bar-make-toggle toggle-save-place-globally save-place
-			"Toggle Saving Place in Files between Sessions"
+			"Save Place in Files between Sessions"
 			"Saving place in files %s"
+                        (require 'saveplace)
 			(setq-default save-place (not (default-value save-place)))))
 (define-key menu-bar-options-menu [uniquify]
   (menu-bar-make-toggle toggle-uniquify-buffer-names uniquify-buffer-name-style
-			"Toggle Directory Names in Buffer Names"
+			"Use Directory Names in Buffer Names"
 			"Directory name in buffer names (uniquify) %s"
 			(require 'uniquify)
 			(setq uniquify-buffer-name-style
@@ -413,16 +415,20 @@
 				  'forward))))
 (define-key menu-bar-options-menu [transient-mark-mode]
   (menu-bar-make-toggle toggle-transient-mark-mode transient-mark-mode
-			"Toggle Transient Mark Mode (highlights region)"
+			"Transient Mark Mode (highlights region)"
 			"Transient Mark mode %s"))
 (define-key menu-bar-options-menu [toggle-auto-compression]
-  '("Toggle Automatic File De/compression" . auto-compression-mode))
+  '(menu-item "Automatic File De/compression"
+             auto-compression-mode .
+             (:button (:toggle . (rassq 'jka-compr-handler
+                                        file-name-handler-alist)))))
 (define-key menu-bar-options-menu [auto-fill-mode]
-  '("Toggle Auto Fill (word wrap) in Text modes"
-    . toggle-text-mode-auto-fill))
+  '(menu-item "Auto Fill (word wrap) in Text modes"
+              toggle-text-mode-auto-fill .
+              (:button (:toggle . (member 'turn-on-auto-fill text-mode-hook)))))
 (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)"
+  (menu-bar-make-toggle toggle-global-lazy-font-lock-mode global-font-lock-mode
+			"Global Font Lock (highlights syntax)"
 			"Global Font Lock mode %s"
 			;; Make sure a support mode is used;
 			;; otherwise Font Lock will be too slow.