]> git.eshelyaron.com Git - emacs.git/commitdiff
(menu-bar-kill-ring-save): New function--use as `copy'.
authorRichard M. Stallman <rms@gnu.org>
Sun, 12 Feb 1995 04:54:34 +0000 (04:54 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 12 Feb 1995 04:54:34 +0000 (04:54 +0000)
(delete-region): Don't enable if (mouse-region-match) is true.

lisp/menu-bar.el

index 5babb7b19e4fe3d8ddade4d4ac1c9435dd749824..51fdfeee42489708e66c6517ab1d74bd8d53920a 100644 (file)
 (defvar yank-menu (cons "Select Yank" nil))
 (fset 'yank-menu (cons 'keymap yank-menu))
 (define-key menu-bar-edit-menu [select-paste] '("Select and Paste" . yank-menu))
-(define-key menu-bar-edit-menu [copy] '("Copy" . kill-ring-save))
+(define-key menu-bar-edit-menu [copy] '("Copy" . menu-bar-kill-ring-save))
 (define-key menu-bar-edit-menu [cut] '("Cut" . kill-region))
 (define-key menu-bar-edit-menu [undo] '("Undo" . undo))
 
+(defun menu-bar-kill-ring-save (beg end)
+  (interactive "r")
+  (if (mouse-region-match)
+      (message "Select a region with the mouse does `copy' automatically")
+    (kill-ring-save beg end)))
+
 (put 'fill-region 'menu-enable 'mark-active)
 (put 'kill-region 'menu-enable 'mark-active)
-(put 'kill-ring-save 'menu-enable 'mark-active)
+(put 'menu-bar-kill-ring-save 'menu-enable 'mark-active)
 (put 'yank 'menu-enable '(x-selection-exists-p))
 (put 'yank-menu 'menu-enable '(cdr yank-menu))
-(put 'delete-region 'menu-enable 'mark-active)
+(put 'delete-region 'menu-enable '(and mark-active
+                                      (not (mouse-region-match))))
 (put 'undo 'menu-enable '(if (eq last-command 'undo)
                             pending-undo-list
                           (consp buffer-undo-list)))
 (autoload 'ispell-menu-map "ispell" nil t 'keymap)
 
 ;; These are alternative definitions for the cut, paste and copy
-;; menu items.  Use them if your system expects these to use the clipboard
+;; menu items.  Use them if your system expects these to use the clipboard.
 
 (put 'clipboard-kill-region 'menu-enable 'mark-active)
 (put 'clipboard-kill-ring-save 'menu-enable 'mark-active)