aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2014-11-01 12:37:14 +0100
committerJan Djärv2014-11-01 12:37:14 +0100
commit722afcab51adbc97b5cc5679c87ed2115259a9a7 (patch)
tree6125d9bbc5b603eacf01e163e78c4710b1ca1c09 /src
parentce4670d74d34148b6c4c4f6b35bb2ab2865e583e (diff)
downloademacs-722afcab51adbc97b5cc5679c87ed2115259a9a7.tar.gz
emacs-722afcab51adbc97b5cc5679c87ed2115259a9a7.zip
* lisp/select.el (gui-get-selection): Comment: data-type ignored on NS.
* src/nsselect.m (ns_get_local_selection): Remove calling of functions in Vselection_converter_alist. (syms_of_nsselect): Remove Vselection_converter_alist. Fixes: debbugs:18911
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/nsselect.m54
2 files changed, 7 insertions, 53 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4337a3f1e67..6580ce2d7ac 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12014-11-01 Jan Djärv <jan.h.d@swipnet.se>
2
3 * nsselect.m (ns_get_local_selection): Remove calling of
4 functions in Vselection_converter_alist (Bug#18911).
5 (syms_of_nsselect): Remove Vselection_converter_alist.
6
12014-10-31 Dmitry Antipov <dmantipov@yandex.ru> 72014-10-31 Dmitry Antipov <dmantipov@yandex.ru>
2 8
3 * font.c (copy_font_spec): Redesign to avoid Fcopy_alist 9 * font.c (copy_font_spec): Redesign to avoid Fcopy_alist
diff --git a/src/nsselect.m b/src/nsselect.m
index 904b3b2e17f..8d3b567e796 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -211,45 +211,8 @@ ns_get_local_selection (Lisp_Object selection_name,
211 Lisp_Object target_type) 211 Lisp_Object target_type)
212{ 212{
213 Lisp_Object local_value; 213 Lisp_Object local_value;
214 Lisp_Object handler_fn, value, check;
215 ptrdiff_t count = specpdl_ptr - specpdl;
216
217 local_value = assq_no_quit (selection_name, Vselection_alist); 214 local_value = assq_no_quit (selection_name, Vselection_alist);
218 215 return local_value;
219 if (NILP (local_value)) return Qnil;
220
221 specbind (Qinhibit_quit, Qt);
222 CHECK_SYMBOL (target_type);
223 handler_fn = Fcdr (Fassq (target_type, Vselection_converter_alist));
224 if (!NILP (handler_fn))
225 value = call3 (handler_fn, selection_name, target_type,
226 XCAR (XCDR (local_value)));
227 else
228 value = Qnil;
229 unbind_to (count, Qnil);
230
231 check = value;
232 if (CONSP (value) && SYMBOLP (XCAR (value)))
233 {
234 check = XCDR (value);
235 }
236
237 if (STRINGP (check) || VECTORP (check) || SYMBOLP (check)
238 || INTEGERP (check) || NILP (value))
239 return value;
240
241 if (CONSP (check)
242 && INTEGERP (XCAR (check))
243 && (INTEGERP (XCDR (check))
244 || (CONSP (XCDR (check))
245 && INTEGERP (XCAR (XCDR (check)))
246 && NILP (XCDR (XCDR (check))))))
247 return value;
248
249 Fsignal (Qerror,
250 list3 (build_string ("invalid data returned by"
251 " selection-conversion function"),
252 handler_fn, value));
253} 216}
254 217
255 218
@@ -571,21 +534,6 @@ This hook doesn't let you change the behavior of Emacs's selection replies,\n\
571it merely informs you that they have happened."); 534it merely informs you that they have happened.");
572 Vns_sent_selection_hooks = Qnil; 535 Vns_sent_selection_hooks = Qnil;
573 536
574 DEFVAR_LISP ("selection-converter-alist", Vselection_converter_alist,
575 "An alist associating X Windows selection-types with functions.\n\
576These functions are called to convert the selection, with three args:\n\
577the name of the selection (typically `PRIMARY', `SECONDARY', or `CLIPBOARD');\n\
578a desired type to which the selection should be converted;\n\
579and the local selection value (whatever was given to `x-own-selection').\n\
580\n\
581The function should return the value to send to the X server\n\
582\(typically a string). A return value of nil\n\
583means that the conversion could not be done.\n\
584A return value which is the symbol `NULL'\n\
585means that a side-effect was executed,\n\
586and there is no meaningful selection value.");
587 Vselection_converter_alist = Qnil;
588
589 DEFVAR_LISP ("ns-lost-selection-hooks", Vns_lost_selection_hooks, 537 DEFVAR_LISP ("ns-lost-selection-hooks", Vns_lost_selection_hooks,
590 "A list of functions to be called when Emacs loses an X selection.\n\ 538 "A list of functions to be called when Emacs loses an X selection.\n\
591\(This happens when some other X client makes its own selection\n\ 539\(This happens when some other X client makes its own selection\n\