From: Eli Zaretskii <eliz@gnu.org>
Date: Thu, 20 Mar 2025 09:03:32 +0000 (+0200)
Subject: Improve 'gui-get-selection' on MS-Windows
X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2bb317796a65e01065f2909d1d3a7316633c35b6;p=emacs.git

Improve 'gui-get-selection' on MS-Windows

* lisp/term/w32-win.el (w32--get-selection): Allow UTF8_STRING and
TEXT data types as well, since w32select.c handles that correctly.

(cherry picked from commit e53b90a5ce21feeb0290fbe035e9a2d6aae34bc3)
---

diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index fa7862d9bff..a1959cd11be 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -416,7 +416,7 @@ also be textual."
 
 (defun w32--get-selection (&optional type data-type)
   (cond ((and (eq type 'CLIPBOARD)
-              (eq data-type 'STRING))
+              (memq data-type '(STRING UTF8_STRING TEXT)))
          (with-demoted-errors "w32-get-clipboard-data:%S"
            (w32-get-clipboard-data)))
         ((eq data-type 'TARGETS)