[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r118083: * lisp/select.el (gui-selection-exists-p-al
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] trunk r118083: * lisp/select.el (gui-selection-exists-p-alist): New method. |
Date: |
Fri, 10 Oct 2014 03:28:34 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 118083
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Thu 2014-10-09 23:28:24 -0400
message:
* 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.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/menu-bar.el menubar.el-20091113204419-o5vbwnq5f7feedwu-546
lisp/select.el select.el-20091113204419-o5vbwnq5f7feedwu-550
lisp/simple.el simple.el-20091113204419-o5vbwnq5f7feedwu-403
lisp/term/ns-win.el nswin.el-20091113204419-o5vbwnq5f7feedwu-8708
lisp/term/pc-win.el pcwin.el-20091113204419-o5vbwnq5f7feedwu-795
lisp/term/w32-win.el w32win.el-20091113204419-o5vbwnq5f7feedwu-943
lisp/term/x-win.el xwin.el-20091113204419-o5vbwnq5f7feedwu-113
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2014-10-10 03:24:41 +0000
+++ b/lisp/ChangeLog 2014-10-10 03:28:24 +0000
@@ -1,3 +1,13 @@
+2014-10-10 Stefan Monnier <address@hidden>
+
+ * select.el (gui-selection-exists-p-alist): New method.
+ * menu-bar.el (menu-bar-edit-menu, clipboard-yank):
+ * simple.el (deactivate-mark): Use it.
+ * term/x-win.el (gui-selection-exists-p):
+ * term/w32-win.el (gui-selection-exists-p):
+ * term/pc-win.el (gui-selection-exists-p):
+ * term/ns-win.el (gui-selection-exists-p): Provide a backend instance.
+
2014-10-10 Glenn Morris <address@hidden>
* info.el (Info-fontify-maximum-menu-size): Bump to 400k. (Bug#16227)
=== modified file 'lisp/menu-bar.el'
--- a/lisp/menu-bar.el 2014-10-06 06:30:07 +0000
+++ b/lisp/menu-bar.el 2014-10-10 03:28:24 +0000
@@ -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 ()
=== modified file 'lisp/select.el'
--- a/lisp/select.el 2014-10-03 02:15:42 +0000
+++ b/lisp/select.el 2014-10-10 03:28:24 +0000
@@ -235,9 +235,14 @@
Called with one argument: (SELECTION).
The arg should be the name of the selection in question, typically one of
the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
-(Those are literal upper-case symbol names, since that's what X expects.)
-For convenience, the symbol nil is the same as `PRIMARY',
-and t is the same as `SECONDARY'.")
+(Those are literal upper-case symbol names, since that's what X expects.)")
+
+(gui-method-declare gui-selection-exists-p #'ignore
+ "Whether there is an owner for the given X Selection.
+Called with one argument: (SELECTION).
+The arg should be the name of the selection in question, typically one of
+the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
+(Those are literal upper-case symbol names, since that's what X expects.)")
(defun gui-set-selection (type data)
"Make an X selection of type TYPE and value DATA.
=== modified file 'lisp/simple.el'
--- a/lisp/simple.el 2014-10-03 01:39:49 +0000
+++ b/lisp/simple.el 2014-10-10 03:28:24 +0000
@@ -4497,8 +4497,6 @@
(signal 'mark-inactive nil)))
;; Behind display-selections-p.
-(declare-function x-selection-exists-p "xselect.c"
- (&optional selection terminal))
(defun deactivate-mark (&optional force)
"Deactivate the mark.
@@ -4529,7 +4527,7 @@
;; deactivation should not clobber it (Bug#11772).
((and (/= (region-beginning) (region-end))
(or (gui-call gui-selection-owner-p 'PRIMARY)
- (null (gui-selection-exists-p 'PRIMARY))))
+ (null (gui-call gui-selection-exists-p 'PRIMARY))))
(gui-set-selection 'PRIMARY
(funcall region-extract-function nil)))))
(when mark-active (force-mode-line-update)) ;Refresh toolbar (bug#16382).
=== modified file 'lisp/term/ns-win.el'
--- a/lisp/term/ns-win.el 2014-10-03 01:39:49 +0000
+++ b/lisp/term/ns-win.el 2014-10-10 03:28:24 +0000
@@ -961,6 +961,7 @@
(gui-method-define gui-own-selection ns #'ns-own-selection-internal)
(gui-method-define gui-disown-selection ns #'ns-disown-selection-internal)
(gui-method-define gui-selection-owner-p ns #'ns-selection-owner-p)
+(gui-method-define gui-selection-exists-p ns #'x-selection-exists-p)
(gui-method-define gui-get-selection ns #'x-get-selection-internal)
;FIXME:name!
(provide 'ns-win)
=== modified file 'lisp/term/pc-win.el'
--- a/lisp/term/pc-win.el 2014-10-03 01:39:49 +0000
+++ b/lisp/term/pc-win.el 2014-10-10 03:28:24 +0000
@@ -228,6 +228,7 @@
(w16-get-clipboard-data))))
;; gui-selection-owner-p is used in simple.el.
+(gui-method-define gui-selection-exists-p pc #'x-selection-exists-p)
(gui-method-define gui-selection-owner-p pc #'w16-selection-owner-p)
(defun w16-selection-owner-p (_selection)
;; FIXME: Other systems don't obey gui-select-enable-clipboard here.
=== modified file 'lisp/term/w32-win.el'
--- a/lisp/term/w32-win.el 2014-10-06 17:47:56 +0000
+++ b/lisp/term/w32-win.el 2014-10-10 03:28:24 +0000
@@ -420,6 +420,7 @@
(lambda (selection)
(and (memq selection '(nil PRIMARY SECONDARY))
(get 'x-selections (or selection 'PRIMARY)))))
+(gui-method-define gui-selection-exists-p w32 #'x-selection-exists-p)
;; The "Windows" keys on newer keyboards bring up the Start menu
;; whether you want it or not - make Emacs ignore these keystrokes
=== modified file 'lisp/term/x-win.el'
--- a/lisp/term/x-win.el 2014-10-03 01:39:49 +0000
+++ b/lisp/term/x-win.el 2014-10-10 03:28:24 +0000
@@ -1473,6 +1473,7 @@
(gui-method-define gui-own-selection x #'x-own-selection-internal)
(gui-method-define gui-disown-selection x #'x-disown-selection-internal)
(gui-method-define gui-selection-owner-p x #'x-selection-owner-p)
+(gui-method-define gui-selection-exists-p x #'x-selection-exists-p)
(gui-method-define gui-get-selection x #'x-get-selection-internal)
;; Initiate drag and drop
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r118083: * lisp/select.el (gui-selection-exists-p-alist): New method.,
Stefan Monnier <=