diff options
| author | Chong Yidong | 2012-09-07 16:58:31 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-09-07 16:58:31 +0800 |
| commit | e5c2edf79ba2b75a3572839fcb9de612f93ab630 (patch) | |
| tree | 97949328a6fba5bf022572d490a3212148f3bed8 /doc | |
| parent | eddb36a7d58b99e43deadcc808347008fe8a8627 (diff) | |
| download | emacs-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/ChangeLog | 2 | ||||
| -rw-r--r-- | doc/lispref/positions.texi | 29 |
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 @@ | |||
| 1 | 2012-09-07 Chong Yidong <cyd@gnu.org> | 1 | 2012-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 | |||
| 874 | remains addressable is called the @dfn{accessible portion} of the | 874 | remains addressable is called the @dfn{accessible portion} of the |
| 875 | buffer. | 875 | buffer. |
| 876 | 876 | ||
| 877 | Narrowing is specified with two buffer positions which become the | 877 | Narrowing is specified with two buffer positions, which become the |
| 878 | beginning and end of the accessible portion. For most editing commands | 878 | beginning and end of the accessible portion. For most editing |
| 879 | and most Emacs primitives, these positions replace the values of the | 879 | commands and primitives, these positions replace the values of the |
| 880 | beginning and end of the buffer. While narrowing is in effect, no text | 880 | beginning and end of the buffer. While narrowing is in effect, no |
| 881 | outside the accessible portion is displayed, and point cannot move | 881 | text outside the accessible portion is displayed, and point cannot |
| 882 | outside the accessible portion. | 882 | move outside the accessible portion. Note that narrowing does not |
| 883 | 883 | alter actual buffer positions (@pxref{Point}); it only determines | |
| 884 | Values such as positions or line numbers, which usually count from the | 884 | which positions are considered the accessible portion of the buffer. |
| 885 | beginning of the buffer, do so despite narrowing, but the functions | 885 | Most functions refuse to operate on text that is outside the |
| 886 | which use them refuse to operate on text that is inaccessible. | 886 | accessible 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 |
| 889 | the entire buffer regardless of any narrowing. | 889 | the 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 | ||
| 928 | This 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{} |
| 928 | This special form saves the current bounds of the accessible portion, | 933 | This special form saves the current bounds of the accessible portion, |
| 929 | evaluates the @var{body} forms, and finally restores the saved bounds, | 934 | evaluates the @var{body} forms, and finally restores the saved bounds, |