aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2012-03-07 13:36:33 +0800
committerChong Yidong2012-03-07 13:36:33 +0800
commit67cd45a2b4cdee89f80460052032ac70c18e9e52 (patch)
tree315652926ce3ce4afa0c9cd4b7364f2c1ab6224c
parent2ad809416d0d9fb2b4cac6136cf3270dee1feb24 (diff)
downloademacs-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/ChangeLog11
-rw-r--r--doc/lispref/markers.texi27
-rw-r--r--doc/lispref/text.texi75
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 @@
12012-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
12012-03-07 Glenn Morris <rgm@gnu.org> 122012-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
422loop by setting the variable @code{deactivate-mark} to a 422loop by setting the variable @code{deactivate-mark} to a
423non-@code{nil} value. 423non-@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
426apply to text near point, apply instead to the region when the mark is 426normally apply to text near point, apply instead to the region when
427active. This is the main motivation for using Transient Mark mode. 427the mark is active. This is the main motivation for using Transient
428(Another is that this enables highlighting of the region when the mark 428Mark mode. (Another is that this enables highlighting of the region
429is active. @xref{Display}.) 429when 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
432list of markers containing previous values of the mark. When editing 432list 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
662larger. 662larger.
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 666command designed to operate on a region should normally use
667should normally use @code{interactive} with the @samp{r} specification 667@code{interactive} with the @samp{r} specification to find the
668to find the beginning and end of the region. This lets other Lisp 668beginning and end of the region. This lets other Lisp programs
669programs specify the bounds explicitly as arguments. (@xref{Interactive 669specify the bounds explicitly as arguments. @xref{Interactive Codes}.
670Codes}.)
671 670
672@defun use-region-p 671@defun use-region-p
673This function returns @code{t} if Transient Mark mode is enabled, the 672This function returns @code{t} if Transient Mark mode is enabled, the
674mark is active, and there's a valid region in the buffer. Commands 673mark is active, and there is a valid region in the buffer. This
675that operate on the region (instead of on text near point) when 674function is intended to be used by commands that operate on the
676there's an active mark should use this to test whether to do that. 675region, 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
170This function returns a string containing a copy of the text of the 170This function returns a string containing a copy of the text of the
171region defined by positions @var{start} and @var{end} in the current 171region defined by positions @var{start} and @var{end} in the current
172buffer. If the arguments are not positions in the accessible portion of 172buffer. If the arguments are not positions in the accessible portion
173the buffer, @code{buffer-substring} signals an @code{args-out-of-range} 173of the buffer, @code{buffer-substring} signals an
174error. 174@code{args-out-of-range} error.
175
176It is not necessary for @var{start} to be less than @var{end}; the
177arguments can be given in either order. But most often the smaller
178argument is written first.
179 175
180Here's an example which assumes Font-Lock mode is not enabled: 176Here'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
218properties, just the characters themselves. @xref{Text Properties}. 214properties, just the characters themselves. @xref{Text Properties}.
219@end defun 215@end defun
220 216
217@defun buffer-string
218This function returns the contents of the entire accessible portion of
219the 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
222This function passes the buffer text between @var{start} and @var{end} 224This function passes the buffer text between @var{start} and @var{end}
223through the filter functions specified by the wrapper hook 225through 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
225result of applying all filters. The obsolete variable 227obsolete variable @code{buffer-substring-filters} is also consulted.
226@code{buffer-substring-filters} is also consulted. If both of these 228If both of these variables are @code{nil}, the value is the unaltered
227variables are @code{nil}, the value is the unaltered text from the 229text from the buffer, i.e.@: what @code{buffer-substring} would
228buffer, as @code{buffer-substring} would return. 230return.
229 231
230If @var{delete} is non-@code{nil}, this function deletes the text 232If @var{delete} is non-@code{nil}, this function deletes the text
231between @var{start} and @var{end} after copying it, like 233between @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
260hook functions acting in sequence. 262hook functions acting in sequence.
261@end defvar 263@end defvar
262 264
263@defun buffer-string 265@defvar buffer-substring-filters
264This function returns the contents of the entire accessible portion of 266This variable is obsoleted by
265the current buffer as a string. It is equivalent to 267@code{filter-buffer-substring-functions}, but is still supported for
266 268backward compatibility. Its value should should be a list of
267@example 269functions which accept a single string argument and return another
268(buffer-substring (point-min) (point-max)) 270string. @code{filter-buffer-substring} passes the buffer substring to
269@end example 271the first function in this list, and the return value of each function
270 272is passed to the next function. The return value of the last function
271@example 273is passed to @code{filter-buffer-substring-functions}.
272@group 274@end defvar
273---------- Buffer: foo ----------
274This 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
285This function returns the symbol (or word) at or near point, as a string. 277This function returns the symbol (or word) at or near point, as a
286The return value includes no text properties. 278string. The return value includes no text properties.
287 279
288If the optional argument @var{really-word} is non-@code{nil}, it finds a 280If the optional argument @var{really-word} is non-@code{nil}, it finds a
289word; otherwise, it finds a symbol (which includes both word 281word; 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
1112the other strings are pushed onto the kill ring, for easy access by 1104the other strings are pushed onto the kill ring, for easy access by
1113@code{yank-pop}. 1105@code{yank-pop}.
1114 1106
1115The normal use of this function is to get the window system's primary 1107The normal use of this function is to get the window system's
1116selection as the most recent kill, even if the selection belongs to 1108clipboard as the most recent kill, even if the selection belongs to
1117another application. @xref{Window System Selections}. However, if 1109another application. @xref{Window System Selections}. However, if
1118the selection was provided by the current Emacs session, this function 1110the clipboard contents come from the current Emacs session, this
1119should return @code{nil}. (If it is hard to tell whether Emacs or 1111function should return @code{nil}.
1120some other program provided the selection, it should be good enough to
1121use @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
1129If the value is a function, @code{kill-new} and @code{kill-append} call 1119If the value is a function, @code{kill-new} and @code{kill-append} call
1130it with the new first element of the kill ring as the argument. 1120it with the new first element of the kill ring as the argument.
1131 1121
1132The normal use of this function is to set the window system's primary 1122The normal use of this function is to put newly killed text in the
1133selection from the newly killed text. 1123window 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