diff options
Diffstat (limited to 'doc/lispref/text.texi')
| -rw-r--r-- | doc/lispref/text.texi | 47 |
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, |
| 867 | and if so appends the killed text to the most recent entry. | 867 | and 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 |
| 870 | This function kills the text in the region defined by @var{start} and | 870 | This 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 |
| 872 | its text properties. The value is always @code{nil}. | 872 | its text properties. The value is always @code{nil}. |
| @@ -874,17 +874,10 @@ its text properties. The value is always @code{nil}. | |||
| 874 | In an interactive call, @var{start} and @var{end} are point and | 874 | In an interactive call, @var{start} and @var{end} are point and |
| 875 | the mark. | 875 | the mark. |
| 876 | 876 | ||
| 877 | @c Emacs 19 feature | ||
| 878 | If the buffer or text is read-only, @code{kill-region} modifies the kill | 877 | If the buffer or text is read-only, @code{kill-region} modifies the kill |
| 879 | ring just the same, then signals an error without modifying the buffer. | 878 | ring just the same, then signals an error without modifying the buffer. |
| 880 | This is convenient because it lets the user use a series of kill | 879 | This is convenient because it lets the user use a series of kill |
| 881 | commands to copy text from a read-only buffer into the kill ring. | 880 | commands to copy text from a read-only buffer into the kill ring. |
| 882 | |||
| 883 | If @var{yank-handler} is non-@code{nil}, this puts that value onto | ||
| 884 | the 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 | ||
| 887 | onto 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}. | |||
| 901 | The command does not set @code{this-command} to @code{kill-region}, so a | 894 | The command does not set @code{this-command} to @code{kill-region}, so a |
| 902 | subsequent kill command does not append to the same kill ring entry. | 895 | subsequent kill command does not append to the same kill ring entry. |
| 903 | 896 | ||
| 904 | Don'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? |
| 905 | support 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 | 899 | In Lisp programs, it is better to use @code{kill-new} or |
| 907 | Ring}. | 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 |
| 1045 | lower level, but still convenient for use in Lisp programs, because they | 1038 | lower level, but are still convenient for use in Lisp programs, |
| 1046 | take care of interaction with window system selections | 1039 | because 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 | |||
| 1069 | move the yanking pointer. | 1062 | move 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 |
| 1073 | This function pushes the text @var{string} onto the kill ring and | 1066 | This function pushes the text @var{string} onto the kill ring and |
| 1074 | makes the yanking pointer point to it. It discards the oldest entry | 1067 | makes the yanking pointer point to it. It discards the oldest entry |
| 1075 | if appropriate. It also invokes the value of | 1068 | if appropriate. It also invokes the value of |
| @@ -1078,25 +1071,15 @@ if appropriate. It also invokes the value of | |||
| 1078 | If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the | 1071 | If @var{replace} is non-@code{nil}, then @code{kill-new} replaces the |
| 1079 | first element of the kill ring with @var{string}, rather than pushing | 1072 | first 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 | |||
| 1082 | If @var{yank-handler} is non-@code{nil}, this puts that value onto | ||
| 1083 | the 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 |
| 1090 | This function appends the text @var{string} to the first entry in the | 1077 | This function appends the text @var{string} to the first entry in the |
| 1091 | kill ring and makes the yanking pointer point to the combined entry. | 1078 | kill ring and makes the yanking pointer point to the combined entry. |
| 1092 | Normally @var{string} goes at the end of the entry, but if | 1079 | Normally @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 |
| 1094 | function also invokes the value of @code{interprogram-cut-function} | 1081 | function 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 | ||
| 1097 | the @code{yank-handler} property of the first entry of the kill ring, | ||
| 1098 | @code{kill-append} pushes the concatenated string onto the kill ring, | ||
| 1099 | instead 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 | ||