diff options
| author | Po Lu | 2022-06-08 20:33:42 +0800 |
|---|---|---|
| committer | Po Lu | 2022-06-08 20:34:13 +0800 |
| commit | 0fd60451bc098b57bdcbddfa98cfa210a6b0ab78 (patch) | |
| tree | 87391cefa7f0bc64460c72a66be10b7e1c0fa24e /src/xselect.c | |
| parent | efe9940567da259d871432cfda4cdf94542ac98e (diff) | |
| download | emacs-0fd60451bc098b57bdcbddfa98cfa210a6b0ab78.tar.gz emacs-0fd60451bc098b57bdcbddfa98cfa210a6b0ab78.zip | |
Allow running some DND tests interactively
* src/xselect.c (x_get_local_selection): Respect new variable.
(syms_of_xselect): New variable
`x-treat-local-requests-remotely'.
* test/lisp/dnd-tests.el (x-begin-drag, gui-set-selection):
Don't redefine these functions under X.
(dnd-tests-verify-selection-data): Use
`x-get-selection-internal' under X.
(dnd-tests-extract-selection-data): New function.
(dnd-tests-begin-text-drag): Update accordingly.
(dnd-tests-begin-file-drag, dnd-tests-begin-drag-files):
Temporarily skip these tests under X.
Diffstat (limited to 'src/xselect.c')
| -rw-r--r-- | src/xselect.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/xselect.c b/src/xselect.c index 40b6571e0ad..a234c7188f3 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -353,7 +353,10 @@ x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type, | |||
| 353 | 353 | ||
| 354 | if (!NILP (handler_fn)) | 354 | if (!NILP (handler_fn)) |
| 355 | value = call3 (handler_fn, selection_symbol, | 355 | value = call3 (handler_fn, selection_symbol, |
| 356 | (local_request ? Qnil : target_type), | 356 | ((local_request |
| 357 | && NILP (Vx_treat_local_requests_remotely)) | ||
| 358 | ? Qnil | ||
| 359 | : target_type), | ||
| 357 | tem); | 360 | tem); |
| 358 | else | 361 | else |
| 359 | value = Qnil; | 362 | value = Qnil; |
| @@ -2798,6 +2801,14 @@ A value of 0 means wait as long as necessary. This is initialized from the | |||
| 2798 | \"*selectionTimeout\" resource. */); | 2801 | \"*selectionTimeout\" resource. */); |
| 2799 | x_selection_timeout = 0; | 2802 | x_selection_timeout = 0; |
| 2800 | 2803 | ||
| 2804 | DEFVAR_LISP ("x-treat-local-requests-remotely", Vx_treat_local_requests_remotely, | ||
| 2805 | doc: /* Whether to treat local selection requests as remote ones. | ||
| 2806 | |||
| 2807 | If non-nil, selection converters for string types (`STRING', | ||
| 2808 | `UTF8_STRING', `COMPOUND_TEXT', etc) will encode the strings, even | ||
| 2809 | when Emacs itself is converting the selection. */); | ||
| 2810 | Vx_treat_local_requests_remotely = Qnil; | ||
| 2811 | |||
| 2801 | /* QPRIMARY is defined in keyboard.c. */ | 2812 | /* QPRIMARY is defined in keyboard.c. */ |
| 2802 | DEFSYM (QSECONDARY, "SECONDARY"); | 2813 | DEFSYM (QSECONDARY, "SECONDARY"); |
| 2803 | DEFSYM (QSTRING, "STRING"); | 2814 | DEFSYM (QSTRING, "STRING"); |