Mercurial > emacs
comparison lisp/menu-bar.el @ 50970:7831ca508f35
(menu-bar-options-menu) <cua-mode>: Use menu-bar-make-mm-toggle.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 13 May 2003 19:13:13 +0000 |
parents | afcd12db0367 |
children | f13922c0480e |
comparison
equal
deleted
inserted
replaced
50969:489cbd8af02e | 50970:7831ca508f35 |
---|---|
1 ;;; menu-bar.el --- define a default menu bar | 1 ;;; menu-bar.el --- define a default menu bar |
2 | 2 |
3 ;; Copyright (C) 1993, 1994, 1995, 2000, 2001, 2002 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1993,94,1995,2000,01,02,2003 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: RMS | 5 ;; Author: RMS |
6 ;; Maintainer: FSF | 6 ;; Maintainer: FSF |
7 ;; Keywords: internal, mouse | 7 ;; Keywords: internal, mouse |
8 | 8 |
880 'forward)))) | 880 'forward)))) |
881 | 881 |
882 (define-key menu-bar-options-menu [edit-options-separator] | 882 (define-key menu-bar-options-menu [edit-options-separator] |
883 '("--")) | 883 '("--")) |
884 (define-key menu-bar-options-menu [cua-mode] | 884 (define-key menu-bar-options-menu [cua-mode] |
885 '(menu-item "CUA-style cut and paste" | 885 (menu-bar-make-mm-toggle cua-mode |
886 menu-bar-toggle-cua-mode | 886 "CUA-style cut and paste" |
887 :help "Use C-z/C-x/C-c/C-v keys for undo/cut/copy/paste" | 887 "Use C-z/C-x/C-c/C-v keys for undo/cut/copy/paste")) |
888 :button (:toggle . cua-mode))) | |
889 | |
890 (defun menu-bar-toggle-cua-mode () | |
891 "Toggle CUA key-binding mode. | |
892 When enabled, using shifted movement keys will activate the region (and | |
893 highlight the region using `transient-mark-mode'), and typed text replaces | |
894 the active selection. C-z, C-x, C-c, and C-v will undo, cut, copy, and | |
895 paste (in addition to the normal Emacs bindings)." | |
896 (interactive) | |
897 (cua-mode nil) | |
898 (customize-mark-as-set 'cua-mode) | |
899 (message "CUA-style cut and paste %s" | |
900 (if cua-mode "enabled" "disabled"))) | |
901 | 888 |
902 (define-key menu-bar-options-menu [case-fold-search] | 889 (define-key menu-bar-options-menu [case-fold-search] |
903 (menu-bar-make-toggle toggle-case-fold-search case-fold-search | 890 (menu-bar-make-toggle toggle-case-fold-search case-fold-search |
904 "Case-Insensitive Search" | 891 "Case-Insensitive Search" |
905 "Case-Insensitive Search %s" | 892 "Case-Insensitive Search %s" |