summaryrefslogtreecommitdiff
path: root/lisp/menu-bar.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2014-10-09 23:28:24 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-10-09 23:28:24 -0400
commita27cd28f9593138b430938854d7613f9029a94a9 (patch)
tree78ec9459774e3ab26acd83b19d5ef555aab6fae3 /lisp/menu-bar.el
parentcd0351b20288ea6edd7a958317114f029a76c1c1 (diff)
downloademacs-a27cd28f9593138b430938854d7613f9029a94a9.tar.gz
* lisp/select.el (gui-selection-exists-p-alist): New method.
* lisp/menu-bar.el (menu-bar-edit-menu, clipboard-yank): * lisp/simple.el (deactivate-mark): Use it. * lisp/term/x-win.el (gui-selection-exists-p): * lisp/term/w32-win.el (gui-selection-exists-p): * lisp/term/pc-win.el (gui-selection-exists-p): * lisp/term/ns-win.el (gui-selection-exists-p): Provide a backend instance.
Diffstat (limited to 'lisp/menu-bar.el')
-rw-r--r--lisp/menu-bar.el14
1 files changed, 5 insertions, 9 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 3c654efb9ba..5ae5da9aff2 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -470,17 +470,14 @@
[paste-from-menu])
;; ns-win.el said: Change text to be more consistent with
;; surrounding menu items `paste', etc."
- `(menu-item ,(if (featurep 'ns) "Select and Paste"
- "Paste from Kill Menu") yank-menu
+ `(menu-item ,(if (featurep 'ns) "Select and Paste" "Paste from Kill Menu")
+ yank-menu
:enable (and (cdr yank-menu) (not buffer-read-only))
:help "Choose a string from the kill ring and paste it"))
(bindings--define-key menu [paste]
'(menu-item "Paste" yank
:enable (and (or
- ;; Emacs compiled --without-x (or --with-ns)
- ;; doesn't have x-selection-exists-p.
- (and (fboundp 'x-selection-exists-p)
- (x-selection-exists-p 'CLIPBOARD))
+ (gui-call gui-selection-exists-p 'CLIPBOARD)
(if (featurep 'ns) ; like paste-from-menu
(cdr yank-menu)
kill-ring))
@@ -537,9 +534,8 @@
'(and mark-active (not buffer-read-only)))
(put 'clipboard-kill-ring-save 'menu-enable 'mark-active)
(put 'clipboard-yank 'menu-enable
- '(and (or (not (fboundp 'x-selection-exists-p))
- (x-selection-exists-p)
- (x-selection-exists-p 'CLIPBOARD))
+ '(and (or (gui-call gui-selection-exists-p 'PRIMARY)
+ (gui-call gui-selection-exists-p 'CLIPBOARD))
(not buffer-read-only)))
(defun clipboard-yank ()