[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
menu-bar.el: x-selection-exists-p
From: |
David Reitter |
Subject: |
menu-bar.el: x-selection-exists-p |
Date: |
Mon, 2 Mar 2009 23:24:36 -0500 |
menu-bar.el contains two uses of `x-selection-exists-p', which is not
defined if Emacs was built with "--without-x".
The first appears to disable the Paste menu item permanently; the
second one calls the function even if it doesn't exist (even though
I'm not sure if the `menu-enable' property on `clipboard-yank' does
what it appears to do).
Are the below changes OK, and is it OK to check this in at this point?
Index: menu-bar.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/menu-bar.el,v
retrieving revision 1.350
diff -c -r1.350 menu-bar.el
*** menu-bar.el 14 Jan 2009 23:11:12 -0000 1.350
--- menu-bar.el 3 Mar 2009 04:11:59 -0000
***************
*** 459,466 ****
: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))
:help "Paste (yank) text most recently cut/copied"))
(define-key menu-bar-edit-menu [copy]
'(menu-item "Copy" menu-bar-kill-ring-save
--- 485,493 ----
:enable (and
;; Emacs compiled --without-x doesn't have
;; x-selection-exists-p.
! (if (fboundp 'x-selection-exists-p)
! (x-selection-exists-p) t)
! (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
***************
*** 495,503 ****
'(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))
! (x-selection-exists-p 'CLIPBOARD))
(not buffer-read-only)))
(defun clipboard-yank ()
--- 527,535 ----
'(and mark-active (not buffer-read-only)))
(put 'clipboard-kill-ring-save 'menu-enable 'mark-active)
(put 'clipboard-yank 'menu-enable
! '(and (if (fboundp 'x-selection-exists-p)
! (or (x-selection-exists-p)
! (x-selection-exists-p 'CLIPBOARD)))
(not buffer-read-only)))
(defun clipboard-yank ()
- menu-bar.el: x-selection-exists-p,
David Reitter <=