aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref/text.texi
diff options
context:
space:
mode:
authorStefan Monnier2010-12-10 19:13:08 -0500
committerStefan Monnier2010-12-10 19:13:08 -0500
commit2c302df3a13236bfbf8ea1b771d13618fcda8d71 (patch)
treef26dc9f22861dc37610de319d05255de058c221b /doc/lispref/text.texi
parent0c747cb143fa227e78f350ac353d703f489209df (diff)
parent175069efeb080517afefdd44a06f7a779ea8c25c (diff)
downloademacs-2c302df3a13236bfbf8ea1b771d13618fcda8d71.tar.gz
emacs-2c302df3a13236bfbf8ea1b771d13618fcda8d71.zip
Merge from trunk
Diffstat (limited to 'doc/lispref/text.texi')
-rw-r--r--doc/lispref/text.texi47
1 files changed, 14 insertions, 33 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 04e1e714133..45d358366de 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -87,7 +87,7 @@ buffer is @samp{@@}:
87 87
88@example 88@example
89@group 89@group
90(char-to-string (char-after 1)) 90(string (char-after 1))
91 @result{} "@@" 91 @result{} "@@"
92@end group 92@end group
93@end example 93@end example
@@ -122,9 +122,9 @@ but there is no peace.
122@end group 122@end group
123 123
124@group 124@group
125(char-to-string (preceding-char)) 125(string (preceding-char))
126 @result{} "a" 126 @result{} "a"
127(char-to-string (following-char)) 127(string (following-char))
128 @result{} "c" 128 @result{} "c"
129@end group 129@end group
130@end example 130@end example
@@ -866,7 +866,7 @@ adds it to the most recent element. It determines automatically (using
866@code{last-command}) whether the previous command was a kill command, 866@code{last-command}) whether the previous command was a kill command,
867and if so appends the killed text to the most recent entry. 867and if so appends the killed text to the most recent entry.
868 868
869@deffn Command kill-region start end &optional yank-handler 869@deffn Command kill-region start end
870This function kills the text in the region defined by @var{start} and 870This function kills the text in the region defined by @var{start} and
871@var{end}. The text is deleted but saved in the kill ring, along with 871@var{end}. The text is deleted but saved in the kill ring, along with
872its text properties. The value is always @code{nil}. 872its text properties. The value is always @code{nil}.
@@ -874,17 +874,10 @@ its text properties. The value is always @code{nil}.
874In an interactive call, @var{start} and @var{end} are point and 874In an interactive call, @var{start} and @var{end} are point and
875the mark. 875the mark.
876 876
877@c Emacs 19 feature
878If the buffer or text is read-only, @code{kill-region} modifies the kill 877If the buffer or text is read-only, @code{kill-region} modifies the kill
879ring just the same, then signals an error without modifying the buffer. 878ring just the same, then signals an error without modifying the buffer.
880This is convenient because it lets the user use a series of kill 879This is convenient because it lets the user use a series of kill
881commands to copy text from a read-only buffer into the kill ring. 880commands to copy text from a read-only buffer into the kill ring.
882
883If @var{yank-handler} is non-@code{nil}, this puts that value onto
884the string of killed text, as a @code{yank-handler} text property.
885@xref{Yanking}. Note that if @var{yank-handler} is @code{nil}, any
886@code{yank-handler} properties present on the killed text are copied
887onto the kill ring, like other text properties.
888@end deffn 881@end deffn
889 882
890@defopt kill-read-only-ok 883@defopt kill-read-only-ok
@@ -901,10 +894,10 @@ from the buffer. It returns @code{nil}.
901The command does not set @code{this-command} to @code{kill-region}, so a 894The command does not set @code{this-command} to @code{kill-region}, so a
902subsequent kill command does not append to the same kill ring entry. 895subsequent kill command does not append to the same kill ring entry.
903 896
904Don't call @code{copy-region-as-kill} in Lisp programs unless you aim to 897@c FIXME Why is it better? Why isn't copy-region-as-kill obsolete then?
905support Emacs 18. For newer Emacs versions, it is better to use 898@c Why is it used in many places in Emacs?
906@code{kill-new} or @code{kill-append} instead. @xref{Low-Level Kill 899In Lisp programs, it is better to use @code{kill-new} or
907Ring}. 900@code{kill-append} instead of this command. @xref{Low-Level Kill Ring}.
908@end deffn 901@end deffn
909 902
910@node Yanking 903@node Yanking
@@ -1042,8 +1035,8 @@ text property, if there is one.
1042@subsection Low-Level Kill Ring 1035@subsection Low-Level Kill Ring
1043 1036
1044 These functions and variables provide access to the kill ring at a 1037 These functions and variables provide access to the kill ring at a
1045lower level, but still convenient for use in Lisp programs, because they 1038lower level, but are still convenient for use in Lisp programs,
1046take care of interaction with window system selections 1039because they take care of interaction with window system selections
1047(@pxref{Window System Selections}). 1040(@pxref{Window System Selections}).
1048 1041
1049@defun current-kill n &optional do-not-move 1042@defun current-kill n &optional do-not-move
@@ -1069,7 +1062,7 @@ it returns the entry pointed at by the yanking pointer and does not
1069move the yanking pointer. 1062move the yanking pointer.
1070@end defun 1063@end defun
1071 1064
1072@defun kill-new string &optional replace yank-handler 1065@defun kill-new string &optional replace
1073This function pushes the text @var{string} onto the kill ring and 1066This function pushes the text @var{string} onto the kill ring and
1074makes the yanking pointer point to it. It discards the oldest entry 1067makes the yanking pointer point to it. It discards the oldest entry
1075if appropriate. It also invokes the value of 1068if appropriate. It also invokes the value of
@@ -1078,25 +1071,15 @@ if appropriate. It also invokes the value of
1078If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the 1071If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the
1079first element of the kill ring with @var{string}, rather than pushing 1072first element of the kill ring with @var{string}, rather than pushing
1080@var{string} onto the kill ring. 1073@var{string} onto the kill ring.
1081
1082If @var{yank-handler} is non-@code{nil}, this puts that value onto
1083the string of killed text, as a @code{yank-handler} property.
1084@xref{Yanking}. Note that if @var{yank-handler} is @code{nil}, then
1085@code{kill-new} copies any @code{yank-handler} properties present on
1086@var{string} onto the kill ring, as it does with other text properties.
1087@end defun 1074@end defun
1088 1075
1089@defun kill-append string before-p &optional yank-handler 1076@defun kill-append string before-p
1090This function appends the text @var{string} to the first entry in the 1077This function appends the text @var{string} to the first entry in the
1091kill ring and makes the yanking pointer point to the combined entry. 1078kill ring and makes the yanking pointer point to the combined entry.
1092Normally @var{string} goes at the end of the entry, but if 1079Normally @var{string} goes at the end of the entry, but if
1093@var{before-p} is non-@code{nil}, it goes at the beginning. This 1080@var{before-p} is non-@code{nil}, it goes at the beginning. This
1094function also invokes the value of @code{interprogram-cut-function} 1081function also invokes the value of @code{interprogram-cut-function}
1095(see below). This handles @var{yank-handler} just like 1082(see below).
1096@code{kill-new}, except that if @var{yank-handler} is different from
1097the @code{yank-handler} property of the first entry of the kill ring,
1098@code{kill-append} pushes the concatenated string onto the kill ring,
1099instead of replacing the original first entry with it.
1100@end defun 1083@end defun
1101 1084
1102@defvar interprogram-paste-function 1085@defvar interprogram-paste-function
@@ -4324,6 +4307,4 @@ code that is itself run from a modification hook, then rebind locally
4324@code{inhibit-modification-hooks} to @code{nil}. 4307@code{inhibit-modification-hooks} to @code{nil}.
4325@end defvar 4308@end defvar
4326 4309
4327@ignore 4310
4328 arch-tag: 3721e738-a1cb-4085-bc1a-6cb8d8e1d32b
4329@end ignore