changeset 40913:02b9ae26c819

(menu-bar-edit-menu): Don't use x-selection-exists-p if it is not fboundp. (clipboard-yank): Ditto.
author Eli Zaretskii <eliz@gnu.org>
date Sun, 11 Nov 2001 14:02:15 +0000
parents 689a6f179313
children a56e5848713b
files lisp/menu-bar.el
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/menu-bar.el	Sun Nov 11 10:33:50 2001 +0000
+++ b/lisp/menu-bar.el	Sun Nov 11 14:02:15 2001 +0000
@@ -398,7 +398,11 @@
 	      :help "Paste (yank) text cut or copied earlier"))
 (define-key menu-bar-edit-menu [paste]
   '(menu-item "Paste" yank
-	      :enable (and (x-selection-exists-p) (not buffer-read-only))
+	      :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
@@ -433,7 +437,8 @@
 (put 'clipboard-kill-region 'menu-enable 'mark-active)
 (put 'clipboard-kill-ring-save 'menu-enable 'mark-active)
 (put 'clipboard-yank 'menu-enable
-     '(or (x-selection-exists-p) (x-selection-exists-p 'CLIPBOARD)))
+     '(or (and (fboundp 'x-selection-exists-p) (x-selection-exists-p))
+	  (x-selection-exists-p 'CLIPBOARD)))
 
 (defun clipboard-yank ()
   "Insert the clipboard contents, or the last stretch of killed text."