diff options
| author | Chong Yidong | 2012-03-07 13:36:33 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-03-07 13:36:33 +0800 |
| commit | 67cd45a2b4cdee89f80460052032ac70c18e9e52 (patch) | |
| tree | 315652926ce3ce4afa0c9cd4b7364f2c1ab6224c | |
| parent | 2ad809416d0d9fb2b4cac6136cf3270dee1feb24 (diff) | |
| download | emacs-67cd45a2b4cdee89f80460052032ac70c18e9e52.tar.gz emacs-67cd45a2b4cdee89f80460052032ac70c18e9e52.zip | |
Minor updates to Markers and Text chapters of Lisp manual.
* doc/lispref/markers.texi (The Mark): Fix typo.
(The Region): Copyedits.
* doc/lispref/text.texi (Buffer Contents): Don't duplicate explanation of
region arguments from Text node. Put doc of obsolete var
buffer-substring-filters back, since it is referred to.
(Low-Level Kill Ring): Yank now uses clipboard instead of primary
selection by default.
| -rw-r--r-- | doc/lispref/ChangeLog | 11 | ||||
| -rw-r--r-- | doc/lispref/markers.texi | 27 | ||||
| -rw-r--r-- | doc/lispref/text.texi | 75 |
3 files changed, 56 insertions, 57 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 59d900ff82c..999714eaf73 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2012-03-07 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * text.texi (Buffer Contents): Don't duplicate explanation of | ||
| 4 | region arguments from Text node. Put doc of obsolete var | ||
| 5 | buffer-substring-filters back, since it is referred to. | ||
| 6 | (Low-Level Kill Ring): Yank now uses clipboard instead of primary | ||
| 7 | selection by default. | ||
| 8 | |||
| 9 | * markers.texi (The Mark): Fix typo. | ||
| 10 | (The Region): Copyedits. | ||
| 11 | |||
| 1 | 2012-03-07 Glenn Morris <rgm@gnu.org> | 12 | 2012-03-07 Glenn Morris <rgm@gnu.org> |
| 2 | 13 | ||
| 3 | * markers.texi (Overview of Markers): Copyedits. | 14 | * markers.texi (Overview of Markers): Copyedits. |
diff --git a/doc/lispref/markers.texi b/doc/lispref/markers.texi index 2bcbf153d8b..653418e8345 100644 --- a/doc/lispref/markers.texi +++ b/doc/lispref/markers.texi | |||
| @@ -422,11 +422,11 @@ can request deactivation of the mark upon return to the editor command | |||
| 422 | loop by setting the variable @code{deactivate-mark} to a | 422 | loop by setting the variable @code{deactivate-mark} to a |
| 423 | non-@code{nil} value. | 423 | non-@code{nil} value. |
| 424 | 424 | ||
| 425 | If Transient Mode is enabled, certain editing commands that normally | 425 | If Transient Mark mode is enabled, certain editing commands that |
| 426 | apply to text near point, apply instead to the region when the mark is | 426 | normally apply to text near point, apply instead to the region when |
| 427 | active. This is the main motivation for using Transient Mark mode. | 427 | the mark is active. This is the main motivation for using Transient |
| 428 | (Another is that this enables highlighting of the region when the mark | 428 | Mark mode. (Another is that this enables highlighting of the region |
| 429 | is active. @xref{Display}.) | 429 | when the mark is active. @xref{Display}.) |
| 430 | 430 | ||
| 431 | In addition to the mark, each buffer has a @dfn{mark ring} which is a | 431 | In addition to the mark, each buffer has a @dfn{mark ring} which is a |
| 432 | list of markers containing previous values of the mark. When editing | 432 | list of markers containing previous values of the mark. When editing |
| @@ -662,16 +662,15 @@ integer). This is the position of either point or the mark, whichever is | |||
| 662 | larger. | 662 | larger. |
| 663 | @end defun | 663 | @end defun |
| 664 | 664 | ||
| 665 | Few programs need to use the @code{region-beginning} and | 665 | Instead of using @code{region-beginning} and @code{region-end}, a |
| 666 | @code{region-end} functions. A command designed to operate on a region | 666 | command designed to operate on a region should normally use |
| 667 | should normally use @code{interactive} with the @samp{r} specification | 667 | @code{interactive} with the @samp{r} specification to find the |
| 668 | to find the beginning and end of the region. This lets other Lisp | 668 | beginning and end of the region. This lets other Lisp programs |
| 669 | programs specify the bounds explicitly as arguments. (@xref{Interactive | 669 | specify the bounds explicitly as arguments. @xref{Interactive Codes}. |
| 670 | Codes}.) | ||
| 671 | 670 | ||
| 672 | @defun use-region-p | 671 | @defun use-region-p |
| 673 | This function returns @code{t} if Transient Mark mode is enabled, the | 672 | This function returns @code{t} if Transient Mark mode is enabled, the |
| 674 | mark is active, and there's a valid region in the buffer. Commands | 673 | mark is active, and there is a valid region in the buffer. This |
| 675 | that operate on the region (instead of on text near point) when | 674 | function is intended to be used by commands that operate on the |
| 676 | there's an active mark should use this to test whether to do that. | 675 | region, instead of on text near point, when the mark is active. |
| 677 | @end defun | 676 | @end defun |
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 416bfef4a60..88cb6a157f8 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -169,13 +169,9 @@ convert any portion of the text in the buffer into a string. | |||
| 169 | @defun buffer-substring start end | 169 | @defun buffer-substring start end |
| 170 | This function returns a string containing a copy of the text of the | 170 | This function returns a string containing a copy of the text of the |
| 171 | region defined by positions @var{start} and @var{end} in the current | 171 | region defined by positions @var{start} and @var{end} in the current |
| 172 | buffer. If the arguments are not positions in the accessible portion of | 172 | buffer. If the arguments are not positions in the accessible portion |
| 173 | the buffer, @code{buffer-substring} signals an @code{args-out-of-range} | 173 | of the buffer, @code{buffer-substring} signals an |
| 174 | error. | 174 | @code{args-out-of-range} error. |
| 175 | |||
| 176 | It is not necessary for @var{start} to be less than @var{end}; the | ||
| 177 | arguments can be given in either order. But most often the smaller | ||
| 178 | argument is written first. | ||
| 179 | 175 | ||
| 180 | Here's an example which assumes Font-Lock mode is not enabled: | 176 | Here's an example which assumes Font-Lock mode is not enabled: |
| 181 | 177 | ||
| @@ -218,14 +214,20 @@ This is like @code{buffer-substring}, except that it does not copy text | |||
| 218 | properties, just the characters themselves. @xref{Text Properties}. | 214 | properties, just the characters themselves. @xref{Text Properties}. |
| 219 | @end defun | 215 | @end defun |
| 220 | 216 | ||
| 217 | @defun buffer-string | ||
| 218 | This function returns the contents of the entire accessible portion of | ||
| 219 | the current buffer as a string. It is equivalent to | ||
| 220 | @w{@code{(buffer-substring (point-min) (point-max))}}. | ||
| 221 | @end defun | ||
| 222 | |||
| 221 | @defun filter-buffer-substring start end &optional delete | 223 | @defun filter-buffer-substring start end &optional delete |
| 222 | This function passes the buffer text between @var{start} and @var{end} | 224 | This function passes the buffer text between @var{start} and @var{end} |
| 223 | through the filter functions specified by the wrapper hook | 225 | through the filter functions specified by the wrapper hook |
| 224 | @code{filter-buffer-substring-functions}, and returns the final | 226 | @code{filter-buffer-substring-functions}, and returns the result. The |
| 225 | result of applying all filters. The obsolete variable | 227 | obsolete variable @code{buffer-substring-filters} is also consulted. |
| 226 | @code{buffer-substring-filters} is also consulted. If both of these | 228 | If both of these variables are @code{nil}, the value is the unaltered |
| 227 | variables are @code{nil}, the value is the unaltered text from the | 229 | text from the buffer, i.e.@: what @code{buffer-substring} would |
| 228 | buffer, as @code{buffer-substring} would return. | 230 | return. |
| 229 | 231 | ||
| 230 | If @var{delete} is non-@code{nil}, this function deletes the text | 232 | If @var{delete} is non-@code{nil}, this function deletes the text |
| 231 | between @var{start} and @var{end} after copying it, like | 233 | between @var{start} and @var{end} after copying it, like |
| @@ -260,30 +262,20 @@ this, and so on. The actual return value is the result of all the | |||
| 260 | hook functions acting in sequence. | 262 | hook functions acting in sequence. |
| 261 | @end defvar | 263 | @end defvar |
| 262 | 264 | ||
| 263 | @defun buffer-string | 265 | @defvar buffer-substring-filters |
| 264 | This function returns the contents of the entire accessible portion of | 266 | This variable is obsoleted by |
| 265 | the current buffer as a string. It is equivalent to | 267 | @code{filter-buffer-substring-functions}, but is still supported for |
| 266 | 268 | backward compatibility. Its value should should be a list of | |
| 267 | @example | 269 | functions which accept a single string argument and return another |
| 268 | (buffer-substring (point-min) (point-max)) | 270 | string. @code{filter-buffer-substring} passes the buffer substring to |
| 269 | @end example | 271 | the first function in this list, and the return value of each function |
| 270 | 272 | is passed to the next function. The return value of the last function | |
| 271 | @example | 273 | is passed to @code{filter-buffer-substring-functions}. |
| 272 | @group | 274 | @end defvar |
| 273 | ---------- Buffer: foo ---------- | ||
| 274 | This is the contents of buffer foo | ||
| 275 | |||
| 276 | ---------- Buffer: foo ---------- | ||
| 277 | |||
| 278 | (buffer-string) | ||
| 279 | @result{} "This is the contents of buffer foo\n" | ||
| 280 | @end group | ||
| 281 | @end example | ||
| 282 | @end defun | ||
| 283 | 275 | ||
| 284 | @defun current-word &optional strict really-word | 276 | @defun current-word &optional strict really-word |
| 285 | This function returns the symbol (or word) at or near point, as a string. | 277 | This function returns the symbol (or word) at or near point, as a |
| 286 | The return value includes no text properties. | 278 | string. The return value includes no text properties. |
| 287 | 279 | ||
| 288 | If the optional argument @var{really-word} is non-@code{nil}, it finds a | 280 | If the optional argument @var{really-word} is non-@code{nil}, it finds a |
| 289 | word; otherwise, it finds a symbol (which includes both word | 281 | word; otherwise, it finds a symbol (which includes both word |
| @@ -1112,13 +1104,11 @@ case, the first string is used as the ``most recent kill'', and all | |||
| 1112 | the other strings are pushed onto the kill ring, for easy access by | 1104 | the other strings are pushed onto the kill ring, for easy access by |
| 1113 | @code{yank-pop}. | 1105 | @code{yank-pop}. |
| 1114 | 1106 | ||
| 1115 | The normal use of this function is to get the window system's primary | 1107 | The normal use of this function is to get the window system's |
| 1116 | selection as the most recent kill, even if the selection belongs to | 1108 | clipboard as the most recent kill, even if the selection belongs to |
| 1117 | another application. @xref{Window System Selections}. However, if | 1109 | another application. @xref{Window System Selections}. However, if |
| 1118 | the selection was provided by the current Emacs session, this function | 1110 | the clipboard contents come from the current Emacs session, this |
| 1119 | should return @code{nil}. (If it is hard to tell whether Emacs or | 1111 | function should return @code{nil}. |
| 1120 | some other program provided the selection, it should be good enough to | ||
| 1121 | use @code{string=} to compare it with the last text Emacs provided.) | ||
| 1122 | @end defvar | 1112 | @end defvar |
| 1123 | 1113 | ||
| 1124 | @defvar interprogram-cut-function | 1114 | @defvar interprogram-cut-function |
| @@ -1129,9 +1119,8 @@ programs, when you are using a window system. Its value should be | |||
| 1129 | If the value is a function, @code{kill-new} and @code{kill-append} call | 1119 | If the value is a function, @code{kill-new} and @code{kill-append} call |
| 1130 | it with the new first element of the kill ring as the argument. | 1120 | it with the new first element of the kill ring as the argument. |
| 1131 | 1121 | ||
| 1132 | The normal use of this function is to set the window system's primary | 1122 | The normal use of this function is to put newly killed text in the |
| 1133 | selection from the newly killed text. | 1123 | window system's clipboard. @xref{Window System Selections}. |
| 1134 | @xref{Window System Selections}. | ||
| 1135 | @end defvar | 1124 | @end defvar |
| 1136 | 1125 | ||
| 1137 | @node Internals of Kill Ring | 1126 | @node Internals of Kill Ring |