From: David Reitter <david.reitter@gmail.com>
To: Emacs-Devel devel <emacs-devel@gnu.org>
Subject: menu-bar.el: x-selection-exists-p
Date: Mon, 2 Mar 2009 23:24:36 -0500 [thread overview]
Message-ID: <7AD9FA63-6D04-4EC4-8E6D-C6DA7215035B@gmail.com> (raw)
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 ()
next reply other threads:[~2009-03-03 4:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-03 4:24 David Reitter [this message]
2009-03-03 14:15 ` menu-bar.el: x-selection-exists-p Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7AD9FA63-6D04-4EC4-8E6D-C6DA7215035B@gmail.com \
--to=david.reitter@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.