diff options
| author | Richard M. Stallman | 1998-03-28 05:43:01 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-03-28 05:43:01 +0000 |
| commit | 89f1709fdea722f418d6002ff564ce09c65e57cc (patch) | |
| tree | f339cc24719bae3c799e5d7db81014395dd0d13d /lisp | |
| parent | 8646fe223f4bf2a6f730daac131ebf427fad20f1 (diff) | |
| download | emacs-89f1709fdea722f418d6002ff564ce09c65e57cc.tar.gz emacs-89f1709fdea722f418d6002ff564ce09c65e57cc.zip | |
(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.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/menu-bar.el | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index b1088108ab8..9a868bdd22a 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -388,24 +388,26 @@ Do the same for the keys of the same name." | |||
| 388 | `(setq ,variable (not ,variable))) | 388 | `(setq ,variable (not ,variable))) |
| 389 | (message ,message "enabled") | 389 | (message ,message "enabled") |
| 390 | (message ,message "disabled"))) | 390 | (message ,message "disabled"))) |
| 391 | '(,doc . ,name))) | 391 | '(menu-item ,doc ,name . |
| 392 | (:button (:toggle . (and (boundp ',variable) ,variable)))))) | ||
| 392 | 393 | ||
| 393 | (define-key menu-bar-options-menu [debug-on-quit] | 394 | (define-key menu-bar-options-menu [debug-on-quit] |
| 394 | (menu-bar-make-toggle toggle-debug-on-quit debug-on-quit | 395 | (menu-bar-make-toggle toggle-debug-on-quit debug-on-quit |
| 395 | "Toggle Debug on Quit" "Debug on Quit %s")) | 396 | "Debug on Quit" "Debug on Quit %s")) |
| 396 | (define-key menu-bar-options-menu [debug-on-error] | 397 | (define-key menu-bar-options-menu [debug-on-error] |
| 397 | (menu-bar-make-toggle toggle-debug-on-error debug-on-error | 398 | (menu-bar-make-toggle toggle-debug-on-error debug-on-error |
| 398 | "Toggle Debug on Error" "Debug on Error %s")) | 399 | "Debug on Error" "Debug on Error %s")) |
| 399 | (define-key menu-bar-options-menu [options-separator] | 400 | (define-key menu-bar-options-menu [options-separator] |
| 400 | '("--")) | 401 | '("--")) |
| 401 | (define-key menu-bar-options-menu [save-place] | 402 | (define-key menu-bar-options-menu [save-place] |
| 402 | (menu-bar-make-toggle toggle-save-place-globally save-place | 403 | (menu-bar-make-toggle toggle-save-place-globally save-place |
| 403 | "Toggle Saving Place in Files between Sessions" | 404 | "Save Place in Files between Sessions" |
| 404 | "Saving place in files %s" | 405 | "Saving place in files %s" |
| 406 | (require 'saveplace) | ||
| 405 | (setq-default save-place (not (default-value save-place))))) | 407 | (setq-default save-place (not (default-value save-place))))) |
| 406 | (define-key menu-bar-options-menu [uniquify] | 408 | (define-key menu-bar-options-menu [uniquify] |
| 407 | (menu-bar-make-toggle toggle-uniquify-buffer-names uniquify-buffer-name-style | 409 | (menu-bar-make-toggle toggle-uniquify-buffer-names uniquify-buffer-name-style |
| 408 | "Toggle Directory Names in Buffer Names" | 410 | "Use Directory Names in Buffer Names" |
| 409 | "Directory name in buffer names (uniquify) %s" | 411 | "Directory name in buffer names (uniquify) %s" |
| 410 | (require 'uniquify) | 412 | (require 'uniquify) |
| 411 | (setq uniquify-buffer-name-style | 413 | (setq uniquify-buffer-name-style |
| @@ -413,16 +415,20 @@ Do the same for the keys of the same name." | |||
| 413 | 'forward)))) | 415 | 'forward)))) |
| 414 | (define-key menu-bar-options-menu [transient-mark-mode] | 416 | (define-key menu-bar-options-menu [transient-mark-mode] |
| 415 | (menu-bar-make-toggle toggle-transient-mark-mode transient-mark-mode | 417 | (menu-bar-make-toggle toggle-transient-mark-mode transient-mark-mode |
| 416 | "Toggle Transient Mark Mode (highlights region)" | 418 | "Transient Mark Mode (highlights region)" |
| 417 | "Transient Mark mode %s")) | 419 | "Transient Mark mode %s")) |
| 418 | (define-key menu-bar-options-menu [toggle-auto-compression] | 420 | (define-key menu-bar-options-menu [toggle-auto-compression] |
| 419 | '("Toggle Automatic File De/compression" . auto-compression-mode)) | 421 | '(menu-item "Automatic File De/compression" |
| 422 | auto-compression-mode . | ||
| 423 | (:button (:toggle . (rassq 'jka-compr-handler | ||
| 424 | file-name-handler-alist))))) | ||
| 420 | (define-key menu-bar-options-menu [auto-fill-mode] | 425 | (define-key menu-bar-options-menu [auto-fill-mode] |
| 421 | '("Toggle Auto Fill (word wrap) in Text modes" | 426 | '(menu-item "Auto Fill (word wrap) in Text modes" |
| 422 | . toggle-text-mode-auto-fill)) | 427 | toggle-text-mode-auto-fill . |
| 428 | (:button (:toggle . (member 'turn-on-auto-fill text-mode-hook))))) | ||
| 423 | (define-key menu-bar-options-menu [toggle-global-lazy-font-lock-mode] | 429 | (define-key menu-bar-options-menu [toggle-global-lazy-font-lock-mode] |
| 424 | (menu-bar-make-toggle toggle-global-lazy-font-lock-mode nil | 430 | (menu-bar-make-toggle toggle-global-lazy-font-lock-mode global-font-lock-mode |
| 425 | "Toggle Global Font Lock (highlights syntax)" | 431 | "Global Font Lock (highlights syntax)" |
| 426 | "Global Font Lock mode %s" | 432 | "Global Font Lock mode %s" |
| 427 | ;; Make sure a support mode is used; | 433 | ;; Make sure a support mode is used; |
| 428 | ;; otherwise Font Lock will be too slow. | 434 | ;; otherwise Font Lock will be too slow. |