summaryrefslogtreecommitdiff
path: root/lisp/menu-bar.el
diff options
context:
space:
mode:
authorKim F. Storm <storm@cua.dk>2002-05-01 22:01:16 +0000
committerKim F. Storm <storm@cua.dk>2002-05-01 22:01:16 +0000
commit06753468d3effdf6fc0f8cd5a7716e9f181825bf (patch)
tree095614fa30ff76c1ac23f229f58fdf9f6a02de74 /lisp/menu-bar.el
parent492274d3fad2344a470f696b5d2055d013c25bb5 (diff)
downloademacs-06753468d3effdf6fc0f8cd5a7716e9f181825bf.tar.gz
(menu-bar-make-toggle): Added optional PROPS arg.
(menu-bar-options-save): Added cua-mode. (menu-bar-options-menu): Added toggle for cua-mode. Disable toggle for transient-mark-mode if cua-mode is enabled.
Diffstat (limited to 'lisp/menu-bar.el')
-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."
;(defvar menu-bar-preferences-menu (make-sparse-keymap "Preferences"))
-(defmacro menu-bar-make-toggle (name variable doc message help &rest body)
+(defmacro menu-bar-make-toggle (name variable doc message help &optional props &rest body)
`(progn
(defun ,name ()
,(concat "Toggle whether to " (downcase (substring help 0 1))
@@ -566,6 +566,7 @@ Do the same for the keys of the same name."
(interactive)
(,name)
(customize-mark-as-set ',variable))
+ ,@(if props props)
:help ,help
:button (:toggle . (and (default-boundp ',variable)
(default-value ',variable))))))
@@ -583,7 +584,7 @@ Do the same for the keys of the same name."
(dolist (elt '(line-number-mode column-number-mode scroll-bar-mode
debug-on-quit debug-on-error menu-bar-mode tool-bar-mode
save-place uniquify-buffer-name-style
- case-fold-search show-paren-mode
+ case-fold-search cua-mode show-paren-mode
transient-mark-mode global-font-lock-mode
display-time-mode auto-compression-mode
current-language-environment default-input-method
@@ -777,6 +778,7 @@ Do the same for the keys of the same name."
"Use Directory Names in Buffer Names"
"Directory name in buffer names (uniquify) %s"
"Uniquify buffer names by adding parent directory names"
+ () ; no props
(require 'uniquify)
(setq uniquify-buffer-name-style
(if (not uniquify-buffer-name-style)
@@ -784,6 +786,16 @@ Do the same for the keys of the same name."
(define-key menu-bar-options-menu [edit-options-separator]
'("--"))
+(define-key menu-bar-options-menu [cua-mode]
+ '(menu-item "CUA-style cut and paste"
+ (lambda ()
+ (interactive)
+ (cua-mode nil)
+ (customize-mark-as-set 'cua-mode)
+ (message "CUA-style cut and paste %s"
+ (if cua-mode "enabled" "disabled")))
+ :help "Use C-z/C-x/C-c/C-v keys for undo/cut/copy/paste"
+ :button (:toggle . cua-mode)))
(define-key menu-bar-options-menu [case-fold-search]
(menu-bar-make-toggle toggle-case-fold-search case-fold-search
"Case-Insensitive Search"
@@ -824,7 +836,8 @@ Do the same for the keys of the same name."
(menu-bar-make-toggle toggle-transient-mark-mode transient-mark-mode
"Active Region Highlighting (Transient Mark mode)"
"Transient Mark mode %s"
- "Make text in active region stand out in color"))
+ "Make text in active region stand out in color"
+ (:enable (not cua-mode))))
(define-key menu-bar-options-menu [toggle-global-lazy-font-lock-mode]
(menu-bar-make-toggle toggle-global-lazy-font-lock-mode global-font-lock-mode
"Syntax Highlighting (Global Font Lock mode)"