aboutsummaryrefslogtreecommitdiffstats
path: root/src/nsselect.m
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/nsselect.m
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/nsselect.m')
-rw-r--r--src/nsselect.m114
1 files changed, 76 insertions, 38 deletions
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