1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

Support 'TARGETS' in clipboard selections on MS-Windows

* src/w32select.c (Fw32_selection_targets): New function.

* lisp/term/w32-win.el (w32--get-selection): Call
'w32-selection-targets' to obtain the list of data formats
available in the clipboard.
This commit is contained in:
Eli Zaretskii 2016-11-01 18:04:07 +02:00
parent 2664eb5394
commit c3640fcc96
2 changed files with 117 additions and 5 deletions

View file

@ -400,11 +400,15 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(put 'x-selections (or type 'PRIMARY) value)))
(defun w32--get-selection (&optional type data-type)
(if (and (eq type 'CLIPBOARD)
(eq data-type 'STRING))
(with-demoted-errors "w32-get-clipboard-data:%S"
(w32-get-clipboard-data))
(get 'x-selections (or type 'PRIMARY))))
(cond ((and (eq type 'CLIPBOARD)
(eq data-type 'STRING))
(with-demoted-errors "w32-get-clipboard-data:%S"
(w32-get-clipboard-data)))
((eq data-type 'TARGETS)
(if (eq type 'CLIPBOARD)
(w32-selection-targets type)
(if (get 'x-selections (or type 'PRIMARY)) '[STRING])))
(t (get 'x-selections (or type 'PRIMARY)))))
(defun w32--selection-owner-p (selection)
(and (memq selection '(nil PRIMARY SECONDARY))