diff options
| author | Richard M. Stallman | 1995-02-12 04:54:34 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-02-12 04:54:34 +0000 |
| commit | 4c0317b1c2de90d16c9dcf03df18afdd0a43b0c8 (patch) | |
| tree | 052f8b36e31522fdf0bcfecb41bc6fec5a399251 | |
| parent | e6c2f5d4b9ccae65782af0042fef3b14f6bbac8b (diff) | |
| download | emacs-4c0317b1c2de90d16c9dcf03df18afdd0a43b0c8.tar.gz emacs-4c0317b1c2de90d16c9dcf03df18afdd0a43b0c8.zip | |
(menu-bar-kill-ring-save): New function--use as `copy'.
(delete-region): Don't enable if (mouse-region-match) is true.
| -rw-r--r-- | lisp/menu-bar.el | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 5babb7b19e4..51fdfeee424 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -121,16 +121,23 @@ | |||
| 121 | (defvar yank-menu (cons "Select Yank" nil)) | 121 | (defvar yank-menu (cons "Select Yank" nil)) |
| 122 | (fset 'yank-menu (cons 'keymap yank-menu)) | 122 | (fset 'yank-menu (cons 'keymap yank-menu)) |
| 123 | (define-key menu-bar-edit-menu [select-paste] '("Select and Paste" . yank-menu)) | 123 | (define-key menu-bar-edit-menu [select-paste] '("Select and Paste" . yank-menu)) |
| 124 | (define-key menu-bar-edit-menu [copy] '("Copy" . kill-ring-save)) | 124 | (define-key menu-bar-edit-menu [copy] '("Copy" . menu-bar-kill-ring-save)) |
| 125 | (define-key menu-bar-edit-menu [cut] '("Cut" . kill-region)) | 125 | (define-key menu-bar-edit-menu [cut] '("Cut" . kill-region)) |
| 126 | (define-key menu-bar-edit-menu [undo] '("Undo" . undo)) | 126 | (define-key menu-bar-edit-menu [undo] '("Undo" . undo)) |
| 127 | 127 | ||
| 128 | (defun menu-bar-kill-ring-save (beg end) | ||
| 129 | (interactive "r") | ||
| 130 | (if (mouse-region-match) | ||
| 131 | (message "Select a region with the mouse does `copy' automatically") | ||
| 132 | (kill-ring-save beg end))) | ||
| 133 | |||
| 128 | (put 'fill-region 'menu-enable 'mark-active) | 134 | (put 'fill-region 'menu-enable 'mark-active) |
| 129 | (put 'kill-region 'menu-enable 'mark-active) | 135 | (put 'kill-region 'menu-enable 'mark-active) |
| 130 | (put 'kill-ring-save 'menu-enable 'mark-active) | 136 | (put 'menu-bar-kill-ring-save 'menu-enable 'mark-active) |
| 131 | (put 'yank 'menu-enable '(x-selection-exists-p)) | 137 | (put 'yank 'menu-enable '(x-selection-exists-p)) |
| 132 | (put 'yank-menu 'menu-enable '(cdr yank-menu)) | 138 | (put 'yank-menu 'menu-enable '(cdr yank-menu)) |
| 133 | (put 'delete-region 'menu-enable 'mark-active) | 139 | (put 'delete-region 'menu-enable '(and mark-active |
| 140 | (not (mouse-region-match)))) | ||
| 134 | (put 'undo 'menu-enable '(if (eq last-command 'undo) | 141 | (put 'undo 'menu-enable '(if (eq last-command 'undo) |
| 135 | pending-undo-list | 142 | pending-undo-list |
| 136 | (consp buffer-undo-list))) | 143 | (consp buffer-undo-list))) |
| @@ -139,7 +146,7 @@ | |||
| 139 | (autoload 'ispell-menu-map "ispell" nil t 'keymap) | 146 | (autoload 'ispell-menu-map "ispell" nil t 'keymap) |
| 140 | 147 | ||
| 141 | ;; These are alternative definitions for the cut, paste and copy | 148 | ;; These are alternative definitions for the cut, paste and copy |
| 142 | ;; menu items. Use them if your system expects these to use the clipboard | 149 | ;; menu items. Use them if your system expects these to use the clipboard. |
| 143 | 150 | ||
| 144 | (put 'clipboard-kill-region 'menu-enable 'mark-active) | 151 | (put 'clipboard-kill-region 'menu-enable 'mark-active) |
| 145 | (put 'clipboard-kill-ring-save 'menu-enable 'mark-active) | 152 | (put 'clipboard-kill-ring-save 'menu-enable 'mark-active) |