diff options
author | Po Lu <luangruo@yahoo.com> | 2022-06-01 16:25:53 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-06-01 16:25:53 +0800 |
commit | f5fadbbfec8c8f5d66fe0169c92096743102990e (patch) | |
tree | a6ff21acff44d0c0d26922bbdf9b69c1ca676703 /src/xselect.c | |
parent | a3d3fef2bc60f05f30350ef1cc0bb66e8f7010c7 (diff) | |
download | emacs-f5fadbbfec8c8f5d66fe0169c92096743102990e.tar.gz |
Clean up text/uri-list mess inside the Dired drag-and-drop code
* doc/lispref/frames.texi (Window System Selections):
* etc/NEWS: Document new changes to `gui-get-selection'.
* lisp/dired.el (dired-mouse-drag): Specify text/uri-list value
explicitly.
* lisp/select.el (gui-set-selection): Update doc string.
(xselect-convert-to-text-uri-list): Update to handle either a
single URL (as a string) or a vector of URLs, instead of file
names.
(xselect-uri-list-available-p): Likewise.
* src/xselect.c (x_get_local_selection): Look in tem's text
properties (if it is a string) for a local value before using
tem itself.
Diffstat (limited to 'src/xselect.c')
-rw-r--r-- | src/xselect.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/xselect.c b/src/xselect.c index a4148735945..5f2a0cf56de 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -399,7 +399,7 @@ static Lisp_Object x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type, bool local_request, struct x_display_info *dpyinfo) { - Lisp_Object local_value; + Lisp_Object local_value, tem; Lisp_Object handler_fn, value, check; local_value = LOCAL_SELECTION (selection_symbol, dpyinfo); @@ -426,10 +426,21 @@ x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type, if (CONSP (handler_fn)) handler_fn = XCDR (handler_fn); + tem = XCAR (XCDR (local_value)); + + if (STRINGP (tem)) + { + local_value = Fget_text_property (make_fixnum (0), + target_type, tem); + + if (!NILP (local_value)) + tem = local_value; + } + if (!NILP (handler_fn)) - value = call3 (handler_fn, - selection_symbol, (local_request ? Qnil : target_type), - XCAR (XCDR (local_value))); + value = call3 (handler_fn, selection_symbol, + (local_request ? Qnil : target_type), + tem); else value = Qnil; value = unbind_to (count, value); |