]> git.eshelyaron.com Git - emacs.git/commitdiff
(clipboard-yank): avoid checking (x-selection-exists-p) if unbound in
authorDavid Reitter <david.reitter@gmail.com>
Wed, 4 Mar 2009 18:57:53 +0000 (18:57 +0000)
committerDavid Reitter <david.reitter@gmail.com>
Wed, 4 Mar 2009 18:57:53 +0000 (18:57 +0000)
order to enable the item.  For paste menu item, same, and check
kill-ring.

lisp/ChangeLog
lisp/menu-bar.el

index f7492e2d93d743711e7fbd4ce78f29ac9fcac228..9bd73463197bb86ec68c432bc46e73e6c73bfd93 100644 (file)
@@ -1,3 +1,9 @@
+2009-03-04  David Reitter <david.reitter@gmail.com>
+
+       * menu-bar.el (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.
+
 2009-03-04  Sam Steingold  <sds@gnu.org>
 
        * progmodes/compile.el (compilation-error-regexp-alist-alist):
index 5b3b5674f3e8d4623f46c16ce9a417619d3fb9dd..24fd88e6819b1e65161e4b7a03f8331dd1faaa59 100644 (file)
              :help "Choose a string from the kill ring and paste it"))
 (define-key menu-bar-edit-menu [paste]
   '(menu-item "Paste" yank
-             :enable (and
-                      ;; Emacs compiled --without-x doesn't have
-                      ;; x-selection-exists-p.
-                      (fboundp 'x-selection-exists-p)
-                      (x-selection-exists-p) (not buffer-read-only))
+             :enable (and (or
+                           ;; Emacs compiled --without-x doesn't have
+                           ;; x-selection-exists-p.
+                           (and (fboundp 'x-selection-exists-p)
+                                (x-selection-exists-p))
+                           kill-ring)
+                          (not buffer-read-only))
              :help "Paste (yank) text most recently cut/copied"))
 (define-key menu-bar-edit-menu [copy]
   '(menu-item "Copy" menu-bar-kill-ring-save
      '(and mark-active (not buffer-read-only)))
 (put 'clipboard-kill-ring-save 'menu-enable 'mark-active)
 (put 'clipboard-yank 'menu-enable
-     '(and (or (and (fboundp 'x-selection-exists-p)
-                   (x-selection-exists-p))
+     '(and (or (not (fboundp 'x-selection-exists-p))
+              (x-selection-exists-p)
               (x-selection-exists-p 'CLIPBOARD))
-          (not buffer-read-only)))
+          (not buffer-read-only)))
 
 (defun clipboard-yank ()
   "Insert the clipboard contents, or the last stretch of killed text."