comparison doc/lispref/text.texi @ 98744:f92a9c4d4746

(Low-Level Kill Ring): interprogram-paste-function can now return a list of strings.
author Eli Zaretskii <eliz@gnu.org>
date Wed, 15 Oct 2008 14:43:23 +0000
parents 2af6e85f13d5
children 046a6bcd118b
comparison
equal deleted inserted replaced
98743:dd700be84287 98744:f92a9c4d4746
1052 1052
1053 If @var{n} is zero, indicating a request for the latest kill, 1053 If @var{n} is zero, indicating a request for the latest kill,
1054 @code{current-kill} calls the value of 1054 @code{current-kill} calls the value of
1055 @code{interprogram-paste-function} (documented below) before 1055 @code{interprogram-paste-function} (documented below) before
1056 consulting the kill ring. If that value is a function and calling it 1056 consulting the kill ring. If that value is a function and calling it
1057 returns a string, @code{current-kill} pushes that string onto the kill 1057 returns a string or a list of several string, @code{current-kill}
1058 ring and returns it. It also sets the yanking pointer to point to 1058 pushes the strings onto the kill ring and returns the first string.
1059 that new entry, regardless of the value of @var{do-not-move}. 1059 It also sets the yanking pointer to point to that new entry,
1060 Otherwise, @code{current-kill} does not treat a zero value for @var{n} 1060 regardless of the value of @var{do-not-move}. Otherwise,
1061 specially: it returns the entry pointed at by the yanking pointer and 1061 @code{current-kill} does not treat a zero value for @var{n} specially:
1062 does not move the yanking pointer. 1062 it returns the entry pointed at by the yanking pointer and does not
1063 move the yanking pointer.
1063 @end defun 1064 @end defun
1064 1065
1065 @defun kill-new string &optional replace yank-handler 1066 @defun kill-new string &optional replace yank-handler
1066 This function pushes the text @var{string} onto the kill ring and 1067 This function pushes the text @var{string} onto the kill ring and
1067 makes the yanking pointer point to it. It discards the oldest entry 1068 makes the yanking pointer point to it. It discards the oldest entry
1100 If the value is a function, @code{current-kill} calls it to get the 1101 If the value is a function, @code{current-kill} calls it to get the
1101 ``most recent kill.'' If the function returns a non-@code{nil} value, 1102 ``most recent kill.'' If the function returns a non-@code{nil} value,
1102 then that value is used as the ``most recent kill.'' If it returns 1103 then that value is used as the ``most recent kill.'' If it returns
1103 @code{nil}, then the front of the kill ring is used. 1104 @code{nil}, then the front of the kill ring is used.
1104 1105
1105 The normal use of this hook is to get the window system's primary 1106 To facilitate support for window systems that support multiple
1107 selections, this function may also return a list of strings. In that
1108 case, the first string is used as the ``most recent kill'', and all
1109 the other strings are pushed onto the kill ring, for easy access by
1110 @code{yank-pop}.
1111
1112 The normal use of this function is to get the window system's primary
1106 selection as the most recent kill, even if the selection belongs to 1113 selection as the most recent kill, even if the selection belongs to
1107 another application. @xref{Window System Selections}. 1114 another application. @xref{Window System Selections}. However, if
1115 the selection was provided by the current Emacs session, this function
1116 should return @code{nil}. (If it is hard to tell whether Emacs or
1117 some other program provided the selection, it should be good enough to
1118 use @code{string=} to compare it with the last text Emacs provided.)
1108 @end defvar 1119 @end defvar
1109 1120
1110 @defvar interprogram-cut-function 1121 @defvar interprogram-cut-function
1111 This variable provides a way of communicating killed text to other 1122 This variable provides a way of communicating killed text to other
1112 programs, when you are using a window system. Its value should be 1123 programs, when you are using a window system. Its value should be
1116 it with the new first element of the kill ring as the first argument. 1127 it with the new first element of the kill ring as the first argument.
1117 The second, optional, argument has the same meaning as the @var{push} 1128 The second, optional, argument has the same meaning as the @var{push}
1118 argument to @code{x-set-cut-buffer} (@pxref{Definition of 1129 argument to @code{x-set-cut-buffer} (@pxref{Definition of
1119 x-set-cut-buffer}) and only affects the second and later cut buffers. 1130 x-set-cut-buffer}) and only affects the second and later cut buffers.
1120 1131
1121 The normal use of this hook is to set the window system's primary 1132 The normal use of this function is to set the window system's primary
1122 selection (and first cut buffer) from the newly killed text. 1133 selection (and first cut buffer) from the newly killed text.
1123 @xref{Window System Selections}. 1134 @xref{Window System Selections}.
1124 @end defvar 1135 @end defvar
1125 1136
1126 @node Internals of Kill Ring 1137 @node Internals of Kill Ring