diff options
| author | Glenn Morris | 2012-02-11 19:13:13 -0800 |
|---|---|---|
| committer | Glenn Morris | 2012-02-11 19:13:13 -0800 |
| commit | bd7da63eec720259e9c45216d3db169a610c9726 (patch) | |
| tree | 6754caa92bae3c69903f7ced080e71a82f3db672 /src | |
| parent | 27463e3eae155f5021ebfc1ca55396f3682975c8 (diff) | |
| download | emacs-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/ChangeLog | 10 | ||||
| -rw-r--r-- | src/nsselect.m | 114 | ||||
| -rw-r--r-- | src/xselect.c | 31 |
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 @@ | |||
| 1 | 2012-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 | |||
| 1 | 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org> | 11 | 2012-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 | ||
| 338 | DEFUN ("x-own-selection-internal", Fx_own_selection_internal, | 338 | DEFUN ("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. |
| 341 | SELECTION-NAME is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. | 341 | SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. |
| 342 | \(Those are literal upper-case symbol names, since that's what X expects.) | ||
| 342 | VALUE is typically a string, or a cons of two markers, but may be | 343 | VALUE is typically a string, or a cons of two markers, but may be |
| 343 | anything that the functions on `selection-converter-alist' know about. */) | 344 | anything that the functions on `selection-converter-alist' know about. |
| 344 | (Lisp_Object selection_name, Lisp_Object selection_value) | 345 | |
| 346 | FRAME should be a frame that should own the selection. If omitted or | ||
| 347 | nil, it defaults to the selected frame. | ||
| 348 | |||
| 349 | On 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 | ||
| 390 | DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal, | 396 | DEFUN ("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) | 399 | Disowning it means there is no such selection. |
| 400 | |||
| 401 | Sets the last-change time for the selection to TIME-OBJECT (by default | ||
| 402 | the time of the last event). | ||
| 403 | |||
| 404 | TERMINAL should be a terminal object or a frame specifying the X | ||
| 405 | server to query. If omitted or nil, that stands for the selected | ||
| 406 | frame's display, or the first available X display. | ||
| 407 | |||
| 408 | On Nextstep, the TIME-OBJECT and TERMINAL arguments are unused. | ||
| 409 | On 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 | ||
| 406 | DEFUN ("x-selection-exists-p", Fx_selection_exists_p, Sx_selection_exists_p, | 423 | DEFUN ("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. |
| 408 | The arg should be the name of the selection in question, typically one of | 425 | SELECTION should be the name of the selection in question, typically |
| 409 | the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. | 426 | one of the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. (X expects |
| 410 | \(Those are literal upper-case symbol names.) | 427 | these literal upper-case names.) The symbol nil is the same as |
| 411 | For convenience, the symbol nil is the same as `PRIMARY', | 428 | `PRIMARY', and t is the same as `SECONDARY'. |
| 412 | and t is the same as `SECONDARY'.) */) | 429 | |
| 413 | (Lisp_Object selection) | 430 | TERMINAL should be a terminal object or a frame specifying the X |
| 431 | server to query. If omitted or nil, that stands for the selected | ||
| 432 | frame's display, or the first available X display. | ||
| 433 | |||
| 434 | On 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 | ||
| 430 | DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p, | 452 | DEFUN ("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. |
| 433 | The arg should be the name of the selection in question, typically one of | 455 | The arg should be the name of the selection in question, typically one of |
| 434 | the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. | 456 | the 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.) |
| 436 | For convenience, the symbol nil is the same as `PRIMARY', | 458 | For convenience, the symbol nil is the same as `PRIMARY', |
| 437 | and t is the same as `SECONDARY'.) */) | 459 | and t is the same as `SECONDARY'. |
| 438 | (Lisp_Object selection) | 460 | |
| 461 | TERMINAL should be a terminal object or a frame specifying the X | ||
| 462 | server to query. If omitted or nil, that stands for the selected | ||
| 463 | frame's display, or the first available X display. | ||
| 464 | |||
| 465 | On 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 | ||
| 448 | DEFUN ("x-get-selection-internal", Fx_get_selection_internal, | 476 | DEFUN ("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. |
| 451 | SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. | 479 | SELECTION-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.) |
| 453 | TYPE is the type of data desired, typically `STRING'. */) | 481 | TARGET-TYPE is the type of data desired, typically `STRING'. |
| 454 | (Lisp_Object selection_name, Lisp_Object target_type) | 482 | |
| 483 | TIME-STAMP is the time to use in the XConvertSelection call for foreign | ||
| 484 | selections. If omitted, defaults to the time for the last event. | ||
| 485 | |||
| 486 | TERMINAL should be a terminal object or a frame specifying the X | ||
| 487 | server to query. If omitted or nil, that stands for the selected | ||
| 488 | frame's display, or the first available X display. | ||
| 489 | |||
| 490 | On 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 | |||
| 1982 | anything that the functions on `selection-converter-alist' know about. | 1982 | anything that the functions on `selection-converter-alist' know about. |
| 1983 | 1983 | ||
| 1984 | FRAME should be a frame that should own the selection. If omitted or | 1984 | FRAME should be a frame that should own the selection. If omitted or |
| 1985 | nil, it defaults to the selected frame. */) | 1985 | nil, it defaults to the selected frame. |
| 1986 | |||
| 1987 | On 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. */) | |||
| 2003 | DEFUN ("x-get-selection-internal", Fx_get_selection_internal, | 2005 | DEFUN ("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. |
| 2006 | SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. | 2008 | SELECTION-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.) |
| 2008 | TYPE is the type of data desired, typically `STRING'. | 2010 | TARGET-TYPE is the type of data desired, typically `STRING'. |
| 2009 | TIME_STAMP is the time to use in the XConvertSelection call for foreign | 2011 | |
| 2012 | TIME-STAMP is the time to use in the XConvertSelection call for foreign | ||
| 2010 | selections. If omitted, defaults to the time for the last event. | 2013 | selections. If omitted, defaults to the time for the last event. |
| 2011 | 2014 | ||
| 2012 | TERMINAL should be a terminal object or a frame specifying the X | 2015 | TERMINAL should be a terminal object or a frame specifying the X |
| 2013 | server to query. If omitted or nil, that stands for the selected | 2016 | server to query. If omitted or nil, that stands for the selected |
| 2014 | frame's display, or the first available X display. */) | 2017 | frame's display, or the first available X display. |
| 2018 | |||
| 2019 | On 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. |
| 2053 | Disowning it means there is no such selection. | 2058 | Disowning it means there is no such selection. |
| 2054 | 2059 | ||
| 2060 | Sets the last-change time for the selection to TIME-OBJECT (by default | ||
| 2061 | the time of the last event). | ||
| 2062 | |||
| 2055 | TERMINAL should be a terminal object or a frame specifying the X | 2063 | TERMINAL should be a terminal object or a frame specifying the X |
| 2056 | server to query. If omitted or nil, that stands for the selected | 2064 | server to query. If omitted or nil, that stands for the selected |
| 2057 | frame's display, or the first available X display. */) | 2065 | frame's display, or the first available X display. |
| 2066 | |||
| 2067 | On Nextstep, the TIME-OBJECT and TERMINAL arguments are unused. | ||
| 2068 | On 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 | ||
| 2111 | TERMINAL should be a terminal object or a frame specifying the X | 2122 | TERMINAL should be a terminal object or a frame specifying the X |
| 2112 | server to query. If omitted or nil, that stands for the selected | 2123 | server to query. If omitted or nil, that stands for the selected |
| 2113 | frame's display, or the first available X display. */) | 2124 | frame's display, or the first available X display. |
| 2125 | |||
| 2126 | On 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 | ||
| 2136 | TERMINAL should be a terminal object or a frame specifying the X | 2149 | TERMINAL should be a terminal object or a frame specifying the X |
| 2137 | server to query. If omitted or nil, that stands for the selected | 2150 | server to query. If omitted or nil, that stands for the selected |
| 2138 | frame's display, or the first available X display. */) | 2151 | frame's display, or the first available X display. |
| 2152 | |||
| 2153 | On 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; |