emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/pgtk 436f21e: Support selection type text/plain on wayland


From: Yuuki Harano
Subject: feature/pgtk 436f21e: Support selection type text/plain on wayland
Date: Tue, 2 Mar 2021 07:13:05 -0500 (EST)

branch: feature/pgtk
commit 436f21eda127882a8408bdc8ae0d398c2cf5aff2
Author: Yuuki Harano <masm+github@masm11.me>
Commit: Yuuki Harano <masm+github@masm11.me>

    Support selection type text/plain on wayland
    
    Apps on XWayland need this.
    
    * lisp/select.el (x-select-request-type): Add choice `text/plain'.
    (gui--selection-value-internal): Add text/plain to the default list.
---
 lisp/select.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/select.el b/lisp/select.el
index 897b66a..5e8a364 100644
--- a/lisp/select.el
+++ b/lisp/select.el
@@ -140,24 +140,26 @@ MS-Windows does not have a \"primary\" selection."
 (defcustom x-select-request-type nil
   "Data type request for X selection.
 The value is one of the following data types, a list of them, or nil:
-  `COMPOUND_TEXT', `UTF8_STRING', `STRING', `TEXT'
+  `COMPOUND_TEXT', `UTF8_STRING', `STRING', `TEXT', `text/plain'
 
 If the value is one of the above symbols, try only the specified type.
 
 If the value is a list of them, try each of them in the specified
 order until succeed.
 
-The value nil is the same as the list (UTF8_STRING COMPOUND_TEXT STRING)."
+The value nil is the same as the list (UTF8_STRING COMPOUND_TEXT STRING 
text/plain)."
   :type '(choice (const :tag "Default" nil)
                 (const COMPOUND_TEXT)
                 (const UTF8_STRING)
                 (const STRING)
                 (const TEXT)
+                 (const text/plain)
                 (set :tag "List of values"
                      (const COMPOUND_TEXT)
                      (const UTF8_STRING)
                      (const STRING)
-                     (const TEXT)))
+                     (const TEXT)
+                      (const text/plain)))
   :group 'killing)
 
 (defun gui--selection-value-internal (type)
@@ -167,7 +169,7 @@ decided by `x-select-request-type'.  The return value is 
already
 decoded.  If `gui-get-selection' signals an error, return nil."
   (let ((request-type (if (memq window-system '(x pgtk))
                           (or x-select-request-type
-                              '(UTF8_STRING COMPOUND_TEXT STRING))
+                              '(UTF8_STRING COMPOUND_TEXT STRING text/plain))
                         'STRING))
        text)
     (with-demoted-errors "gui-get-selection: %S"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]