diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-10-01 23:19:32 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2014-10-01 23:19:32 -0400 |
commit | 31300bee24ddcfd7dc27e757513d3c176a7fad83 (patch) | |
tree | 28aba34a75aeafb3246cb60f2c8c55d3043436f8 /lisp/obsolete/mouse-sel.el | |
parent | c7c0acd47bad506647ca3445aba1ced77d201daf (diff) | |
download | emacs-31300bee24ddcfd7dc27e757513d3c176a7fad83.tar.gz |
Consolidate management/ownership of selections.
* lisp/select.el (gui-get-selection-alist): New method.
(gui-get-selection): Use it. Rename from x-get-selection.
(x-get-selection): Define as obsolete alias.
(x-get-clipboard): Mark obsolete.
(gui-get-primary-selection): New function.
(x-get-selection-value): Mark obsolete.
(gui-own-selection-alist, gui-disown-selection-alist)
(gui-selection-owner-p-alist): New methods.
(gui-set-selection): Use them. Rename from x-set-selection.
(x-set-selection): Define as obsolete alias.
(gui--valid-simple-selection-p): Rename from
x-valid-simple-selection-p.
* lisp/w32-common-fns.el (gui-own-selection, gui-disown-selection)
(gui-selection-owner-p, gui-get-selection): Define for w32.
(w32-get-selection-value): Rename from x-get-selection-value.
Use the new gui-last-selected-text.
* lisp/term/x-win.el (x-get-selection-value): Remove.
(x-clipboard-yank): Declare obsolete.
(gui-own-selection, gui-disown-selection, gui-get-selection)
(gui-selection-owner-p): Define for x.
* lisp/term/w32-win.el (w32-win-suspend-error): Rename from
x-win-suspend-error.
* lisp/term/pc-win.el (w16-get-selection-value): Rename from
x-get-selection-value.
(w16-selection-owner-p): Rename from x-selection-owner-p.
(gui-own-selection, gui-disown-selection, gui-get-selection)
(gui-selection-owner-p): Define for pc.
(w16--select-text): New function.
* lisp/term/ns-win.el (gui-own-selection, gui-disown-selection)
(gui-get-selection, gui-selection-owner-p): Define for ns.
* lisp/term.el (term-mouse-paste):
* lisp/mouse.el (mouse-yank-primary): Use gui-get-primary-selection.
* src/nsselect.m (ns-own-selection-internal, ns-disown-selection-internal):
Rename from the "x-" prefix.
Diffstat (limited to 'lisp/obsolete/mouse-sel.el')
-rw-r--r-- | lisp/obsolete/mouse-sel.el | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lisp/obsolete/mouse-sel.el b/lisp/obsolete/mouse-sel.el index 21765c3d652..7d7cd1f137f 100644 --- a/lisp/obsolete/mouse-sel.el +++ b/lisp/obsolete/mouse-sel.el @@ -97,7 +97,7 @@ ;; In this mode, mouse-insert-selection just calls mouse-yank-at-click. ;; ;; Selection/kill-ring interaction is retained -;; interprogram-cut-function = x-select-text +;; interprogram-cut-function = gui-select-text ;; interprogram-paste-function = x-selection-value ;; ;; What you lose is the ability to select some text in @@ -292,15 +292,13 @@ where SELECTION-NAME = name of selection SELECTION-THING-SYMBOL = name of variable where the current selection type for this selection should be stored.") -(declare-function x-select-text "term/common-win" (text)) - (defvar mouse-sel-set-selection-function (if (eq mouse-sel-default-bindings 'interprogram-cut-paste) - 'x-set-selection + 'gui-set-selection (lambda (selection value) (if (eq selection 'PRIMARY) - (x-select-text value) - (x-set-selection selection value)))) + (gui-select-text value) + (gui-set-selection selection value)))) "Function to call to set selection. Called with two arguments: @@ -316,7 +314,6 @@ is `interprogram-cut-paste'.") (lambda (selection) (if (eq selection 'PRIMARY) (or (x-selection-value) - (bound-and-true-p x-last-selected-text) (bound-and-true-p x-last-selected-text-primary)) (x-get-selection selection))) "Function to call to get the selection. |