aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGlenn Morris2012-02-11 19:13:13 -0800
committerGlenn Morris2012-02-11 19:13:13 -0800
commitbd7da63eec720259e9c45216d3db169a610c9726 (patch)
tree6754caa92bae3c69903f7ced080e71a82f3db672 /src
parent27463e3eae155f5021ebfc1ca55396f3682975c8 (diff)
downloademacs-bd7da63eec720259e9c45216d3db169a610c9726.tar.gz
emacs-bd7da63eec720259e9c45216d3db169a610c9726.zip
Yet more syncing of xselect docs and argument specs
* src/xselect.c (Fx_own_selection_internal) (Fx_get_selection_internal, Fx_disown_selection_internal) (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes. * src/nsselect.m (Fx_own_selection_internal) (Fx_disown_selection_internal, Fx_selection_exists_p) (Fx_selection_owner_p, Fx_get_selection_internal): Sync docs and argument specs with the xselect.c versions. * lisp/term/pc-win.el (x-selection-owner-p, x-own-selection-internal) (x-disown-selection-internal, x-get-selection-internal): Sync docs with the xselect.c versions.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/nsselect.m114
-rw-r--r--src/xselect.c31
3 files changed, 109 insertions, 46 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d18c1b0344e..cfbd29dbc85 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
12012-02-12 Glenn Morris <rgm@gnu.org>
2
3 * xselect.c (Fx_own_selection_internal)
4 (Fx_get_selection_internal, Fx_disown_selection_internal)
5 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
6 * nsselect.m (Fx_own_selection_internal)
7 (Fx_disown_selection_internal, Fx_selection_exists_p)
8 (Fx_selection_owner_p, Fx_get_selection_internal):
9 Sync docs and argument specs with the xselect.c versions.
10
12012-02-11 Lars Ingebrigtsen <larsi@gnus.org> 112012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
2 12
3 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails. 13 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
diff --git a/src/nsselect.m b/src/nsselect.m
index 120dcb34f67..4d901fac2ec 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -336,12 +336,18 @@ ns_string_to_pasteboard (id pb, Lisp_Object str)
336 336
337 337
338DEFUN ("x-own-selection-internal", Fx_own_selection_internal, 338DEFUN ("x-own-selection-internal", Fx_own_selection_internal,
339 Sx_own_selection_internal, 2, 2, 0, 339 Sx_own_selection_internal, 2, 3, 0,
340 doc: /* Assert a selection. 340 doc: /* Assert an X selection of type SELECTION and value VALUE.
341SELECTION-NAME is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. 341SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
342\(Those are literal upper-case symbol names, since that's what X expects.)
342VALUE is typically a string, or a cons of two markers, but may be 343VALUE is typically a string, or a cons of two markers, but may be
343anything that the functions on `selection-converter-alist' know about. */) 344anything that the functions on `selection-converter-alist' know about.
344 (Lisp_Object selection_name, Lisp_Object selection_value) 345
346FRAME should be a frame that should own the selection. If omitted or
347nil, it defaults to the selected frame.
348
349On Nextstep, FRAME is unused. */)
350 (Lisp_Object selection, Lisp_Object value, Lisp_Object frame)
345{ 351{
346 id pb; 352 id pb;
347 Lisp_Object old_value, new_value; 353 Lisp_Object old_value, new_value;
@@ -351,15 +357,15 @@ anything that the functions on `selection-converter-alist' know about. */)
351 357
352 358
353 check_ns (); 359 check_ns ();
354 CHECK_SYMBOL (selection_name); 360 CHECK_SYMBOL (selection);
355 if (NILP (selection_value)) 361 if (NILP (value))
356 error ("selection-value may not be nil."); 362 error ("selection value may not be nil.");
357 pb = ns_symbol_to_pb (selection_name); 363 pb = ns_symbol_to_pb (selection);
358 if (pb == nil) return Qnil; 364 if (pb == nil) return Qnil;
359 365
360 ns_declare_pasteboard (pb); 366 ns_declare_pasteboard (pb);
361 old_value = assq_no_quit (selection_name, Vselection_alist); 367 old_value = assq_no_quit (selection, Vselection_alist);
362 new_value = Fcons (selection_name, Fcons (selection_value, Qnil)); 368 new_value = Fcons (selection, Fcons (value, Qnil));
363 369
364 if (NILP (old_value)) 370 if (NILP (old_value))
365 Vselection_alist = Fcons (new_value, Vselection_alist); 371 Vselection_alist = Fcons (new_value, Vselection_alist);
@@ -369,7 +375,7 @@ anything that the functions on `selection-converter-alist' know about. */)
369 /* We only support copy of text. */ 375 /* We only support copy of text. */
370 type = NSStringPboardType; 376 type = NSStringPboardType;
371 target_symbol = ns_string_to_symbol (type); 377 target_symbol = ns_string_to_symbol (type);
372 data = ns_get_local_selection (selection_name, target_symbol); 378 data = ns_get_local_selection (selection, target_symbol);
373 if (!NILP (data)) 379 if (!NILP (data))
374 { 380 {
375 if (STRINGP (data)) 381 if (STRINGP (data))
@@ -380,37 +386,53 @@ anything that the functions on `selection-converter-alist' know about. */)
380 if (!EQ (Vns_sent_selection_hooks, Qunbound)) 386 if (!EQ (Vns_sent_selection_hooks, Qunbound))
381 { 387 {
382 for (rest = Vns_sent_selection_hooks; CONSP (rest); rest = Fcdr (rest)) 388 for (rest = Vns_sent_selection_hooks; CONSP (rest); rest = Fcdr (rest))
383 call3 (Fcar (rest), selection_name, target_symbol, successful_p); 389 call3 (Fcar (rest), selection, target_symbol, successful_p);
384 } 390 }
385 391
386 return selection_value; 392 return value;
387} 393}
388 394
389 395
390DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal, 396DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,
391 Sx_disown_selection_internal, 1, 2, 0, 397 Sx_disown_selection_internal, 1, 3, 0,
392 doc: /* If we own the selection SELECTION, disown it. */) 398 doc: /* If we own the selection SELECTION, disown it.
393 (Lisp_Object selection_name, Lisp_Object time) 399Disowning it means there is no such selection.
400
401Sets the last-change time for the selection to TIME-OBJECT (by default
402the time of the last event).
403
404TERMINAL should be a terminal object or a frame specifying the X
405server to query. If omitted or nil, that stands for the selected
406frame's display, or the first available X display.
407
408On Nextstep, the TIME-OBJECT and TERMINAL arguments are unused.
409On MS-DOS, all this does is return non-nil if we own the selection. */)
410 (Lisp_Object selection, Lisp_Object time_object, Lisp_Object terminal)
394{ 411{
395 id pb; 412 id pb;
396 check_ns (); 413 check_ns ();
397 CHECK_SYMBOL (selection_name); 414 CHECK_SYMBOL (selection);
398 if (NILP (assq_no_quit (selection_name, Vselection_alist))) return Qnil; 415 if (NILP (assq_no_quit (selection, Vselection_alist))) return Qnil;
399 416
400 pb = ns_symbol_to_pb (selection_name); 417 pb = ns_symbol_to_pb (selection);
401 if (pb != nil) ns_undeclare_pasteboard (pb); 418 if (pb != nil) ns_undeclare_pasteboard (pb);
402 return Qt; 419 return Qt;
403} 420}
404 421
405 422
406DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p, 423DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p,
407 0, 1, 0, doc: /* Whether there is an owner for the given selection. 424 0, 2, 0, doc: /* Whether there is an owner for the given X selection.
408The arg should be the name of the selection in question, typically one of 425SELECTION should be the name of the selection in question, typically
409the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. 426one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. (X expects
410\(Those are literal upper-case symbol names.) 427these literal upper-case names.) The symbol nil is the same as
411For convenience, the symbol nil is the same as `PRIMARY', 428`PRIMARY', and t is the same as `SECONDARY'.
412and t is the same as `SECONDARY'.) */) 429
413 (Lisp_Object selection) 430TERMINAL should be a terminal object or a frame specifying the X
431server to query. If omitted or nil, that stands for the selected
432frame's display, or the first available X display.
433
434On Nextstep, TERMINAL is unused. */)
435 (Lisp_Object selection, Lisp_Object terminal)
414{ 436{
415 id pb; 437 id pb;
416 NSArray *types; 438 NSArray *types;
@@ -428,14 +450,20 @@ and t is the same as `SECONDARY'.) */)
428 450
429 451
430DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p, 452DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p,
431 0, 1, 0, 453 0, 2, 0,
432 doc: /* Whether the current Emacs process owns the given selection. 454 doc: /* Whether the current Emacs process owns the given X Selection.
433The arg should be the name of the selection in question, typically one of 455The arg should be the name of the selection in question, typically one of
434the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. 456the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'.
435\(Those are literal upper-case symbol names.) 457\(Those are literal upper-case symbol names, since that's what X expects.)
436For convenience, the symbol nil is the same as `PRIMARY', 458For convenience, the symbol nil is the same as `PRIMARY',
437and t is the same as `SECONDARY'.) */) 459and t is the same as `SECONDARY'.
438 (Lisp_Object selection) 460
461TERMINAL should be a terminal object or a frame specifying the X
462server to query. If omitted or nil, that stands for the selected
463frame's display, or the first available X display.
464
465On Nextstep, TERMINAL is unused. */)
466 (Lisp_Object selection, Lisp_Object terminal)
439{ 467{
440 check_ns (); 468 check_ns ();
441 CHECK_SYMBOL (selection); 469 CHECK_SYMBOL (selection);
@@ -446,12 +474,22 @@ and t is the same as `SECONDARY'.) */)
446 474
447 475
448DEFUN ("x-get-selection-internal", Fx_get_selection_internal, 476DEFUN ("x-get-selection-internal", Fx_get_selection_internal,
449 Sx_get_selection_internal, 2, 2, 0, 477 Sx_get_selection_internal, 2, 4, 0,
450 doc: /* Return text selected from some pasteboard. 478 doc: /* Return text selected from some X window.
451SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. 479SELECTION-SYMBOL is typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
452\(Those are literal upper-case symbol names.) 480\(Those are literal upper-case symbol names, since that's what X expects.)
453TYPE is the type of data desired, typically `STRING'. */) 481TARGET-TYPE is the type of data desired, typically `STRING'.
454 (Lisp_Object selection_name, Lisp_Object target_type) 482
483TIME-STAMP is the time to use in the XConvertSelection call for foreign
484selections. If omitted, defaults to the time for the last event.
485
486TERMINAL should be a terminal object or a frame specifying the X
487server to query. If omitted or nil, that stands for the selected
488frame's display, or the first available X display.
489
490On Nextstep, TIME-STAMP and TERMINAL are unused. */)
491 (Lisp_Object selection_name, Lisp_Object target_type,
492 Lisp_Object time_stamp, Lisp_Object terminal)
455{ 493{
456 Lisp_Object val; 494 Lisp_Object val;
457 495
diff --git a/src/xselect.c b/src/xselect.c
index 85c9c40cc34..49955f03fd0 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1982,7 +1982,9 @@ VALUE is typically a string, or a cons of two markers, but may be
1982anything that the functions on `selection-converter-alist' know about. 1982anything that the functions on `selection-converter-alist' know about.
1983 1983
1984FRAME should be a frame that should own the selection. If omitted or 1984FRAME should be a frame that should own the selection. If omitted or
1985nil, it defaults to the selected frame. */) 1985nil, it defaults to the selected frame.
1986
1987On Nextstep, FRAME is unused. */)
1986 (Lisp_Object selection, Lisp_Object value, Lisp_Object frame) 1988 (Lisp_Object selection, Lisp_Object value, Lisp_Object frame)
1987{ 1989{
1988 if (NILP (frame)) frame = selected_frame; 1990 if (NILP (frame)) frame = selected_frame;
@@ -2003,15 +2005,18 @@ nil, it defaults to the selected frame. */)
2003DEFUN ("x-get-selection-internal", Fx_get_selection_internal, 2005DEFUN ("x-get-selection-internal", Fx_get_selection_internal,
2004 Sx_get_selection_internal, 2, 4, 0, 2006 Sx_get_selection_internal, 2, 4, 0,
2005 doc: /* Return text selected from some X window. 2007 doc: /* Return text selected from some X window.
2006SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. 2008SELECTION-SYMBOL is typically `PRIMARY', `SECONDARY', or `CLIPBOARD'.
2007\(Those are literal upper-case symbol names, since that's what X expects.) 2009\(Those are literal upper-case symbol names, since that's what X expects.)
2008TYPE is the type of data desired, typically `STRING'. 2010TARGET-TYPE is the type of data desired, typically `STRING'.
2009TIME_STAMP is the time to use in the XConvertSelection call for foreign 2011
2012TIME-STAMP is the time to use in the XConvertSelection call for foreign
2010selections. If omitted, defaults to the time for the last event. 2013selections. If omitted, defaults to the time for the last event.
2011 2014
2012TERMINAL should be a terminal object or a frame specifying the X 2015TERMINAL should be a terminal object or a frame specifying the X
2013server to query. If omitted or nil, that stands for the selected 2016server to query. If omitted or nil, that stands for the selected
2014frame's display, or the first available X display. */) 2017frame's display, or the first available X display.
2018
2019On Nextstep, TIME-STAMP and TERMINAL are unused. */)
2015 (Lisp_Object selection_symbol, Lisp_Object target_type, 2020 (Lisp_Object selection_symbol, Lisp_Object target_type,
2016 Lisp_Object time_stamp, Lisp_Object terminal) 2021 Lisp_Object time_stamp, Lisp_Object terminal)
2017{ 2022{
@@ -2052,9 +2057,15 @@ DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal,
2052 doc: /* If we own the selection SELECTION, disown it. 2057 doc: /* If we own the selection SELECTION, disown it.
2053Disowning it means there is no such selection. 2058Disowning it means there is no such selection.
2054 2059
2060Sets the last-change time for the selection to TIME-OBJECT (by default
2061the time of the last event).
2062
2055TERMINAL should be a terminal object or a frame specifying the X 2063TERMINAL should be a terminal object or a frame specifying the X
2056server to query. If omitted or nil, that stands for the selected 2064server to query. If omitted or nil, that stands for the selected
2057frame's display, or the first available X display. */) 2065frame's display, or the first available X display.
2066
2067On Nextstep, the TIME-OBJECT and TERMINAL arguments are unused.
2068On MS-DOS, all this does is return non-nil if we own the selection. */)
2058 (Lisp_Object selection, Lisp_Object time_object, Lisp_Object terminal) 2069 (Lisp_Object selection, Lisp_Object time_object, Lisp_Object terminal)
2059{ 2070{
2060 Time timestamp; 2071 Time timestamp;
@@ -2110,7 +2121,9 @@ and t is the same as `SECONDARY'.
2110 2121
2111TERMINAL should be a terminal object or a frame specifying the X 2122TERMINAL should be a terminal object or a frame specifying the X
2112server to query. If omitted or nil, that stands for the selected 2123server to query. If omitted or nil, that stands for the selected
2113frame's display, or the first available X display. */) 2124frame's display, or the first available X display.
2125
2126On Nextstep, TERMINAL is unused. */)
2114 (Lisp_Object selection, Lisp_Object terminal) 2127 (Lisp_Object selection, Lisp_Object terminal)
2115{ 2128{
2116 struct frame *f = frame_for_x_selection (terminal); 2129 struct frame *f = frame_for_x_selection (terminal);
@@ -2135,7 +2148,9 @@ these literal upper-case names.) The symbol nil is the same as
2135 2148
2136TERMINAL should be a terminal object or a frame specifying the X 2149TERMINAL should be a terminal object or a frame specifying the X
2137server to query. If omitted or nil, that stands for the selected 2150server to query. If omitted or nil, that stands for the selected
2138frame's display, or the first available X display. */) 2151frame's display, or the first available X display.
2152
2153On Nextstep, TERMINAL is unused. */)
2139 (Lisp_Object selection, Lisp_Object terminal) 2154 (Lisp_Object selection, Lisp_Object terminal)
2140{ 2155{
2141 Window owner; 2156 Window owner;