diff options
| author | Yuuki Harano | 2021-03-02 21:08:50 +0900 |
|---|---|---|
| committer | Yuuki Harano | 2021-03-02 21:08:50 +0900 |
| commit | 436f21eda127882a8408bdc8ae0d398c2cf5aff2 (patch) | |
| tree | 424de9e835f39e35ad6c34eb512671b1351e7424 | |
| parent | 9f7fde8dc9cae395605b4923324895fbe7c1c8d0 (diff) | |
| download | emacs-436f21eda127882a8408bdc8ae0d398c2cf5aff2.tar.gz emacs-436f21eda127882a8408bdc8ae0d398c2cf5aff2.zip | |
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.
| -rw-r--r-- | lisp/select.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/select.el b/lisp/select.el index 897b66a028c..5e8a3640238 100644 --- a/lisp/select.el +++ b/lisp/select.el | |||
| @@ -140,24 +140,26 @@ MS-Windows does not have a \"primary\" selection." | |||
| 140 | (defcustom x-select-request-type nil | 140 | (defcustom x-select-request-type nil |
| 141 | "Data type request for X selection. | 141 | "Data type request for X selection. |
| 142 | The value is one of the following data types, a list of them, or nil: | 142 | The value is one of the following data types, a list of them, or nil: |
| 143 | `COMPOUND_TEXT', `UTF8_STRING', `STRING', `TEXT' | 143 | `COMPOUND_TEXT', `UTF8_STRING', `STRING', `TEXT', `text/plain' |
| 144 | 144 | ||
| 145 | If the value is one of the above symbols, try only the specified type. | 145 | If the value is one of the above symbols, try only the specified type. |
| 146 | 146 | ||
| 147 | If the value is a list of them, try each of them in the specified | 147 | If the value is a list of them, try each of them in the specified |
| 148 | order until succeed. | 148 | order until succeed. |
| 149 | 149 | ||
| 150 | The value nil is the same as the list (UTF8_STRING COMPOUND_TEXT STRING)." | 150 | The value nil is the same as the list (UTF8_STRING COMPOUND_TEXT STRING text/plain)." |
| 151 | :type '(choice (const :tag "Default" nil) | 151 | :type '(choice (const :tag "Default" nil) |
| 152 | (const COMPOUND_TEXT) | 152 | (const COMPOUND_TEXT) |
| 153 | (const UTF8_STRING) | 153 | (const UTF8_STRING) |
| 154 | (const STRING) | 154 | (const STRING) |
| 155 | (const TEXT) | 155 | (const TEXT) |
| 156 | (const text/plain) | ||
| 156 | (set :tag "List of values" | 157 | (set :tag "List of values" |
| 157 | (const COMPOUND_TEXT) | 158 | (const COMPOUND_TEXT) |
| 158 | (const UTF8_STRING) | 159 | (const UTF8_STRING) |
| 159 | (const STRING) | 160 | (const STRING) |
| 160 | (const TEXT))) | 161 | (const TEXT) |
| 162 | (const text/plain))) | ||
| 161 | :group 'killing) | 163 | :group 'killing) |
| 162 | 164 | ||
| 163 | (defun gui--selection-value-internal (type) | 165 | (defun gui--selection-value-internal (type) |
| @@ -167,7 +169,7 @@ decided by `x-select-request-type'. The return value is already | |||
| 167 | decoded. If `gui-get-selection' signals an error, return nil." | 169 | decoded. If `gui-get-selection' signals an error, return nil." |
| 168 | (let ((request-type (if (memq window-system '(x pgtk)) | 170 | (let ((request-type (if (memq window-system '(x pgtk)) |
| 169 | (or x-select-request-type | 171 | (or x-select-request-type |
| 170 | '(UTF8_STRING COMPOUND_TEXT STRING)) | 172 | '(UTF8_STRING COMPOUND_TEXT STRING text/plain)) |
| 171 | 'STRING)) | 173 | 'STRING)) |
| 172 | text) | 174 | text) |
| 173 | (with-demoted-errors "gui-get-selection: %S" | 175 | (with-demoted-errors "gui-get-selection: %S" |