diff options
| author | David Reitter | 2009-03-04 18:57:53 +0000 |
|---|---|---|
| committer | David Reitter | 2009-03-04 18:57:53 +0000 |
| commit | a728dc59a12466bf8bb5f0769b5abe9a53498f48 (patch) | |
| tree | d59087d31339acf5fcd65de5929cf3e4dc5a6212 | |
| parent | 4891ba1dcf9b4efc0b4449a09071714ae3fc2454 (diff) | |
| download | emacs-a728dc59a12466bf8bb5f0769b5abe9a53498f48.tar.gz emacs-a728dc59a12466bf8bb5f0769b5abe9a53498f48.zip | |
(clipboard-yank): avoid checking (x-selection-exists-p) if unbound in
order to enable the item. For paste menu item, same, and check
kill-ring.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/menu-bar.el | 18 |
2 files changed, 16 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f7492e2d93d..9bd73463197 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2009-03-04 David Reitter <david.reitter@gmail.com> | ||
| 2 | |||
| 3 | * menu-bar.el (clipboard-yank): avoid | ||
| 4 | checking (x-selection-exists-p) if unbound in order to enable the | ||
| 5 | item. For paste menu item, same, and check kill-ring. | ||
| 6 | |||
| 1 | 2009-03-04 Sam Steingold <sds@gnu.org> | 7 | 2009-03-04 Sam Steingold <sds@gnu.org> |
| 2 | 8 | ||
| 3 | * progmodes/compile.el (compilation-error-regexp-alist-alist): | 9 | * progmodes/compile.el (compilation-error-regexp-alist-alist): |
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 5b3b5674f3e..24fd88e6819 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -456,11 +456,13 @@ | |||
| 456 | :help "Choose a string from the kill ring and paste it")) | 456 | :help "Choose a string from the kill ring and paste it")) |
| 457 | (define-key menu-bar-edit-menu [paste] | 457 | (define-key menu-bar-edit-menu [paste] |
| 458 | '(menu-item "Paste" yank | 458 | '(menu-item "Paste" yank |
| 459 | :enable (and | 459 | :enable (and (or |
| 460 | ;; Emacs compiled --without-x doesn't have | 460 | ;; Emacs compiled --without-x doesn't have |
| 461 | ;; x-selection-exists-p. | 461 | ;; x-selection-exists-p. |
| 462 | (fboundp 'x-selection-exists-p) | 462 | (and (fboundp 'x-selection-exists-p) |
| 463 | (x-selection-exists-p) (not buffer-read-only)) | 463 | (x-selection-exists-p)) |
| 464 | kill-ring) | ||
| 465 | (not buffer-read-only)) | ||
| 464 | :help "Paste (yank) text most recently cut/copied")) | 466 | :help "Paste (yank) text most recently cut/copied")) |
| 465 | (define-key menu-bar-edit-menu [copy] | 467 | (define-key menu-bar-edit-menu [copy] |
| 466 | '(menu-item "Copy" menu-bar-kill-ring-save | 468 | '(menu-item "Copy" menu-bar-kill-ring-save |
| @@ -495,10 +497,10 @@ | |||
| 495 | '(and mark-active (not buffer-read-only))) | 497 | '(and mark-active (not buffer-read-only))) |
| 496 | (put 'clipboard-kill-ring-save 'menu-enable 'mark-active) | 498 | (put 'clipboard-kill-ring-save 'menu-enable 'mark-active) |
| 497 | (put 'clipboard-yank 'menu-enable | 499 | (put 'clipboard-yank 'menu-enable |
| 498 | '(and (or (and (fboundp 'x-selection-exists-p) | 500 | '(and (or (not (fboundp 'x-selection-exists-p)) |
| 499 | (x-selection-exists-p)) | 501 | (x-selection-exists-p) |
| 500 | (x-selection-exists-p 'CLIPBOARD)) | 502 | (x-selection-exists-p 'CLIPBOARD)) |
| 501 | (not buffer-read-only))) | 503 | (not buffer-read-only))) |
| 502 | 504 | ||
| 503 | (defun clipboard-yank () | 505 | (defun clipboard-yank () |
| 504 | "Insert the clipboard contents, or the last stretch of killed text." | 506 | "Insert the clipboard contents, or the last stretch of killed text." |