aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/menu-bar.el19
1 files changed, 16 insertions, 3 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index adc4c466124..d610386db6e 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -540,7 +540,7 @@ Do the same for the keys of the same name."
540 540
541;(defvar menu-bar-preferences-menu (make-sparse-keymap "Preferences")) 541;(defvar menu-bar-preferences-menu (make-sparse-keymap "Preferences"))
542 542
543(defmacro menu-bar-make-toggle (name variable doc message help &rest body) 543(defmacro menu-bar-make-toggle (name variable doc message help &optional props &rest body)
544 `(progn 544 `(progn
545 (defun ,name () 545 (defun ,name ()
546 ,(concat "Toggle whether to " (downcase (substring help 0 1)) 546 ,(concat "Toggle whether to " (downcase (substring help 0 1))
@@ -566,6 +566,7 @@ Do the same for the keys of the same name."
566 (interactive) 566 (interactive)
567 (,name) 567 (,name)
568 (customize-mark-as-set ',variable)) 568 (customize-mark-as-set ',variable))
569 ,@(if props props)
569 :help ,help 570 :help ,help
570 :button (:toggle . (and (default-boundp ',variable) 571 :button (:toggle . (and (default-boundp ',variable)
571 (default-value ',variable)))))) 572 (default-value ',variable))))))
@@ -583,7 +584,7 @@ Do the same for the keys of the same name."
583 (dolist (elt '(line-number-mode column-number-mode scroll-bar-mode 584 (dolist (elt '(line-number-mode column-number-mode scroll-bar-mode
584 debug-on-quit debug-on-error menu-bar-mode tool-bar-mode 585 debug-on-quit debug-on-error menu-bar-mode tool-bar-mode
585 save-place uniquify-buffer-name-style 586 save-place uniquify-buffer-name-style
586 case-fold-search show-paren-mode 587 case-fold-search cua-mode show-paren-mode
587 transient-mark-mode global-font-lock-mode 588 transient-mark-mode global-font-lock-mode
588 display-time-mode auto-compression-mode 589 display-time-mode auto-compression-mode
589 current-language-environment default-input-method 590 current-language-environment default-input-method
@@ -777,6 +778,7 @@ Do the same for the keys of the same name."
777 "Use Directory Names in Buffer Names" 778 "Use Directory Names in Buffer Names"
778 "Directory name in buffer names (uniquify) %s" 779 "Directory name in buffer names (uniquify) %s"
779 "Uniquify buffer names by adding parent directory names" 780 "Uniquify buffer names by adding parent directory names"
781 () ; no props
780 (require 'uniquify) 782 (require 'uniquify)
781 (setq uniquify-buffer-name-style 783 (setq uniquify-buffer-name-style
782 (if (not uniquify-buffer-name-style) 784 (if (not uniquify-buffer-name-style)
@@ -784,6 +786,16 @@ Do the same for the keys of the same name."
784 786
785(define-key menu-bar-options-menu [edit-options-separator] 787(define-key menu-bar-options-menu [edit-options-separator]
786 '("--")) 788 '("--"))
789(define-key menu-bar-options-menu [cua-mode]
790 '(menu-item "CUA-style cut and paste"
791 (lambda ()
792 (interactive)
793 (cua-mode nil)
794 (customize-mark-as-set 'cua-mode)
795 (message "CUA-style cut and paste %s"
796 (if cua-mode "enabled" "disabled")))
797 :help "Use C-z/C-x/C-c/C-v keys for undo/cut/copy/paste"
798 :button (:toggle . cua-mode)))
787(define-key menu-bar-options-menu [case-fold-search] 799(define-key menu-bar-options-menu [case-fold-search]
788 (menu-bar-make-toggle toggle-case-fold-search case-fold-search 800 (menu-bar-make-toggle toggle-case-fold-search case-fold-search
789 "Case-Insensitive Search" 801 "Case-Insensitive Search"
@@ -824,7 +836,8 @@ Do the same for the keys of the same name."
824 (menu-bar-make-toggle toggle-transient-mark-mode transient-mark-mode 836 (menu-bar-make-toggle toggle-transient-mark-mode transient-mark-mode
825 "Active Region Highlighting (Transient Mark mode)" 837 "Active Region Highlighting (Transient Mark mode)"
826 "Transient Mark mode %s" 838 "Transient Mark mode %s"
827 "Make text in active region stand out in color")) 839 "Make text in active region stand out in color"
840 (:enable (not cua-mode))))
828(define-key menu-bar-options-menu [toggle-global-lazy-font-lock-mode] 841(define-key menu-bar-options-menu [toggle-global-lazy-font-lock-mode]
829 (menu-bar-make-toggle toggle-global-lazy-font-lock-mode global-font-lock-mode 842 (menu-bar-make-toggle toggle-global-lazy-font-lock-mode global-font-lock-mode
830 "Syntax Highlighting (Global Font Lock mode)" 843 "Syntax Highlighting (Global Font Lock mode)"