diff options
| author | Martin Rudalics | 2007-11-19 07:48:56 +0000 |
|---|---|---|
| committer | Martin Rudalics | 2007-11-19 07:48:56 +0000 |
| commit | c328399020e81d7b69c57d1df3363acbc4cf3f1b (patch) | |
| tree | 5ebcdc05aa34db2829a8417ffb9a2ee87a8da3db | |
| parent | e7c10f83b381cbc91742f2e2021d9a411bef24e2 (diff) | |
| download | emacs-c328399020e81d7b69c57d1df3363acbc4cf3f1b.tar.gz emacs-c328399020e81d7b69c57d1df3363acbc4cf3f1b.zip | |
(top-level): Deactivate clipboard-kill-region and
clipboard-yank when the buffer is read-only.
| -rw-r--r-- | lisp/menu-bar.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index c05a4e66a9a..ca20f6182fc 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -504,11 +504,14 @@ A large number or nil slows down menu responsiveness." | |||
| 504 | ;; These are alternative definitions for the cut, paste and copy | 504 | ;; These are alternative definitions for the cut, paste and copy |
| 505 | ;; menu items. Use them if your system expects these to use the clipboard. | 505 | ;; menu items. Use them if your system expects these to use the clipboard. |
| 506 | 506 | ||
| 507 | (put 'clipboard-kill-region 'menu-enable 'mark-active) | 507 | (put 'clipboard-kill-region 'menu-enable |
| 508 | '(and mark-active (not buffer-read-only))) | ||
| 508 | (put 'clipboard-kill-ring-save 'menu-enable 'mark-active) | 509 | (put 'clipboard-kill-ring-save 'menu-enable 'mark-active) |
| 509 | (put 'clipboard-yank 'menu-enable | 510 | (put 'clipboard-yank 'menu-enable |
| 510 | '(or (and (fboundp 'x-selection-exists-p) (x-selection-exists-p)) | 511 | '(and (or (and (fboundp 'x-selection-exists-p) |
| 511 | (x-selection-exists-p 'CLIPBOARD))) | 512 | (x-selection-exists-p)) |
| 513 | (x-selection-exists-p 'CLIPBOARD)) | ||
| 514 | (not buffer-read-only))) | ||
| 512 | 515 | ||
| 513 | (defun clipboard-yank () | 516 | (defun clipboard-yank () |
| 514 | "Insert the clipboard contents, or the last stretch of killed text." | 517 | "Insert the clipboard contents, or the last stretch of killed text." |