diff options
author | Eli Zaretskii <eliz@gnu.org> | 2016-11-01 18:04:07 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2016-11-01 18:04:07 +0200 |
commit | c3640fcc96ed80368209c73d7ac9a0f0d1833d93 (patch) | |
tree | 0de0a41fcf5807bd01f72c0db1eac44144a79e32 /lisp/term | |
parent | 2664eb539416bf4cf3f87578726d849ec6560a76 (diff) | |
download | emacs-c3640fcc96ed80368209c73d7ac9a0f0d1833d93.tar.gz |
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.
Diffstat (limited to 'lisp/term')
-rw-r--r-- | lisp/term/w32-win.el | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index f705ec17a55..d8cf5efcfab 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -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)) |