aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorChong Yidong2012-09-07 16:58:31 +0800
committerChong Yidong2012-09-07 16:58:31 +0800
commite5c2edf79ba2b75a3572839fcb9de612f93ab630 (patch)
tree97949328a6fba5bf022572d490a3212148f3bed8 /doc
parenteddb36a7d58b99e43deadcc808347008fe8a8627 (diff)
downloademacs-e5c2edf79ba2b75a3572839fcb9de612f93ab630.tar.gz
emacs-e5c2edf79ba2b75a3572839fcb9de612f93ab630.zip
Add a utility function buffer-narrowed-p, and use it.
* lisp/subr.el (buffer-narrowed-p): New function. * lisp/ses.el (ses-widen): * lisp/simple.el (count-words--buffer-message): * lisp/net/browse-url.el (browse-url-of-buffer): Use it * lisp/simple.el (count-words-region): Don't signal an error if there is a non-nil prefix arg and the mark is not set. * doc/lispref/positions.texi (Narrowing): Document buffer-narrowed-p.
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/ChangeLog2
-rw-r--r--doc/lispref/positions.texi29
2 files changed, 19 insertions, 12 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index bd21100dd4c..179f81990a7 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,5 +1,7 @@
12012-09-07 Chong Yidong <cyd@gnu.org> 12012-09-07 Chong Yidong <cyd@gnu.org>
2 2
3 * positions.texi (Narrowing): Document buffer-narrowed-p.
4
3 * markers.texi (Moving Markers): Add xref to Point (Bug#7151). 5 * markers.texi (Moving Markers): Add xref to Point (Bug#7151).
4 6
5 * syntax.texi (Low-Level Parsing): Add xref to Parser State 7 * syntax.texi (Low-Level Parsing): Add xref to Parser State
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi
index a0c65319850..c4576e6456d 100644
--- a/doc/lispref/positions.texi
+++ b/doc/lispref/positions.texi
@@ -874,18 +874,18 @@ commands to a limited range of characters in a buffer. The text that
874remains addressable is called the @dfn{accessible portion} of the 874remains addressable is called the @dfn{accessible portion} of the
875buffer. 875buffer.
876 876
877 Narrowing is specified with two buffer positions which become the 877 Narrowing is specified with two buffer positions, which become the
878beginning and end of the accessible portion. For most editing commands 878beginning and end of the accessible portion. For most editing
879and most Emacs primitives, these positions replace the values of the 879commands and primitives, these positions replace the values of the
880beginning and end of the buffer. While narrowing is in effect, no text 880beginning and end of the buffer. While narrowing is in effect, no
881outside the accessible portion is displayed, and point cannot move 881text outside the accessible portion is displayed, and point cannot
882outside the accessible portion. 882move outside the accessible portion. Note that narrowing does not
883 883alter actual buffer positions (@pxref{Point}); it only determines
884 Values such as positions or line numbers, which usually count from the 884which positions are considered the accessible portion of the buffer.
885beginning of the buffer, do so despite narrowing, but the functions 885Most functions refuse to operate on text that is outside the
886which use them refuse to operate on text that is inaccessible. 886accessible portion.
887 887
888 The commands for saving buffers are unaffected by narrowing; they save 888 Commands for saving buffers are unaffected by narrowing; they save
889the entire buffer regardless of any narrowing. 889the entire buffer regardless of any narrowing.
890 890
891 If you need to display in a single buffer several very different 891 If you need to display in a single buffer several very different
@@ -924,6 +924,11 @@ It is equivalent to the following expression:
924@end example 924@end example
925@end deffn 925@end deffn
926 926
927@defun buffer-narrowed-p
928This function returns non-@code{nil} if the buffer is narrowed, and
929@code{nil} otherwise.
930@end defun
931
927@defspec save-restriction body@dots{} 932@defspec save-restriction body@dots{}
928This special form saves the current bounds of the accessible portion, 933This special form saves the current bounds of the accessible portion,
929evaluates the @var{body} forms, and finally restores the saved bounds, 934evaluates the @var{body} forms, and finally restores the saved bounds,