]> git.eshelyaron.com Git - emacs.git/commitdiff
(top-level): Deactivate clipboard-kill-region and
authorMartin Rudalics <rudalics@gmx.at>
Mon, 19 Nov 2007 07:48:56 +0000 (07:48 +0000)
committerMartin Rudalics <rudalics@gmx.at>
Mon, 19 Nov 2007 07:48:56 +0000 (07:48 +0000)
clipboard-yank when the buffer is read-only.

lisp/menu-bar.el

index c05a4e66a9ab907e55304529c677f95c197cf7ad..ca20f6182fc55b8f5f29c98db52ff5912189e76c 100644 (file)
@@ -504,11 +504,14 @@ A large number or nil slows down menu responsiveness."
 ;; These are alternative definitions for the cut, paste and copy
 ;; menu items.  Use them if your system expects these to use the clipboard.
 
-(put 'clipboard-kill-region 'menu-enable 'mark-active)
+(put 'clipboard-kill-region 'menu-enable
+     '(and mark-active (not buffer-read-only)))
 (put 'clipboard-kill-ring-save 'menu-enable 'mark-active)
 (put 'clipboard-yank 'menu-enable
-     '(or (and (fboundp 'x-selection-exists-p) (x-selection-exists-p))
-         (x-selection-exists-p 'CLIPBOARD)))
+     '(and (or (and (fboundp 'x-selection-exists-p)
+                   (x-selection-exists-p))
+              (x-selection-exists-p 'CLIPBOARD))
+          (not buffer-read-only)))
 
 (defun clipboard-yank ()
   "Insert the clipboard contents, or the last stretch of killed text."