diff options
| author | Daniel Colascione | 2012-09-17 04:07:36 -0800 |
|---|---|---|
| committer | Daniel Colascione | 2012-09-17 04:07:36 -0800 |
| commit | 2ab329f3b5d52a39f0a45c3d9c129f1c19560142 (patch) | |
| tree | 6dd6784d63e54cb18071df8e28fbdbc27d418728 /doc/lispref | |
| parent | f701ab72dd55460d23c8b029550aa4d7ecef3cfa (diff) | |
| parent | bb7dce392f6d9d5fc4b9d7de09ff920a52f07669 (diff) | |
| download | emacs-2ab329f3b5d52a39f0a45c3d9c129f1c19560142.tar.gz emacs-2ab329f3b5d52a39f0a45c3d9c129f1c19560142.zip | |
Merge from trunk
Diffstat (limited to 'doc/lispref')
| -rw-r--r-- | doc/lispref/ChangeLog | 53 | ||||
| -rw-r--r-- | doc/lispref/commands.texi | 11 | ||||
| -rw-r--r-- | doc/lispref/debugging.texi | 5 | ||||
| -rw-r--r-- | doc/lispref/eval.texi | 1 | ||||
| -rw-r--r-- | doc/lispref/lists.texi | 33 | ||||
| -rw-r--r-- | doc/lispref/markers.texi | 6 | ||||
| -rw-r--r-- | doc/lispref/minibuf.texi | 49 | ||||
| -rw-r--r-- | doc/lispref/numbers.texi | 35 | ||||
| -rw-r--r-- | doc/lispref/positions.texi | 29 | ||||
| -rw-r--r-- | doc/lispref/searching.texi | 8 | ||||
| -rw-r--r-- | doc/lispref/syntax.texi | 64 | ||||
| -rw-r--r-- | doc/lispref/variables.texi | 7 | ||||
| -rw-r--r-- | doc/lispref/windows.texi | 36 |
13 files changed, 193 insertions, 144 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index b0156e5ac7e..ce99c81a912 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,56 @@ | |||
| 1 | 2012-09-11 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Simplify, document, and port floating-point (Bug#12381). | ||
| 4 | * numbers.texi (Float Basics, Arithmetic Operations, Math Functions): | ||
| 5 | Document that / and mod (with floating point arguments), along | ||
| 6 | with asin, acos, log, log10, expt and sqrt, return special values | ||
| 7 | instead of signaling exceptions. | ||
| 8 | (Float Basics): Document that logb operates on the absolute value | ||
| 9 | of its argument. | ||
| 10 | (Math Functions): Document that (log ARG BASE) also returns NaN if | ||
| 11 | BASE is negative. Document that (expt X Y) returns NaN if X is a | ||
| 12 | finite negative number and Y a finite non-integer. | ||
| 13 | |||
| 14 | 2012-09-09 Chong Yidong <cyd@gnu.org> | ||
| 15 | |||
| 16 | * lists.texi (Sets And Lists): Explain that the return value for | ||
| 17 | delete should be used, like for delq. | ||
| 18 | |||
| 19 | * minibuf.texi (Yes-or-No Queries): Document recentering and | ||
| 20 | scrolling in y-or-n-p. Remove gratuitous example. | ||
| 21 | |||
| 22 | * searching.texi (Search and Replace): Document window scrolling | ||
| 23 | entries in query-replace-map. | ||
| 24 | |||
| 25 | 2012-09-08 Chong Yidong <cyd@gnu.org> | ||
| 26 | |||
| 27 | * syntax.texi (Syntax Table Internals): Define "raw syntax | ||
| 28 | descriptor" terminology (Bug#12383). | ||
| 29 | (Syntax Descriptors): Mention raw syntax descriptors. | ||
| 30 | |||
| 31 | 2012-09-07 Chong Yidong <cyd@gnu.org> | ||
| 32 | |||
| 33 | * variables.texi (Creating Buffer-Local): Fix description of | ||
| 34 | local-variable-if-set-p (Bug#10713). | ||
| 35 | |||
| 36 | * eval.texi (Intro Eval): Add index entry for sexp (Bug#12233). | ||
| 37 | |||
| 38 | * windows.texi (Display Action Functions) | ||
| 39 | (Choosing Window Options): Remove obsolete variable | ||
| 40 | display-buffer-reuse-frames. | ||
| 41 | (Switching Buffers): Minor doc tweak for switch-to-buffer. | ||
| 42 | |||
| 43 | * positions.texi (Narrowing): Document buffer-narrowed-p. | ||
| 44 | |||
| 45 | * markers.texi (Moving Markers): Add xref to Point (Bug#7151). | ||
| 46 | |||
| 47 | * syntax.texi (Low-Level Parsing): Add xref to Parser State | ||
| 48 | (Bug#12269). | ||
| 49 | |||
| 50 | 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org> | ||
| 51 | |||
| 52 | * debugging.texi (Explicit Debug): Document `debug-on-message'. | ||
| 53 | |||
| 1 | 2012-09-02 Chong Yidong <cyd@gnu.org> | 54 | 2012-09-02 Chong Yidong <cyd@gnu.org> |
| 2 | 55 | ||
| 3 | * windows.texi (Window Configurations): Recommend against using | 56 | * windows.texi (Window Configurations): Recommend against using |
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 7e24de94fbe..dc0fa4c639d 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi | |||
| @@ -2738,17 +2738,6 @@ This function converts the string or vector @var{key} to a list of | |||
| 2738 | individual events, which you can put in @code{unread-command-events}. | 2738 | individual events, which you can put in @code{unread-command-events}. |
| 2739 | @end defun | 2739 | @end defun |
| 2740 | 2740 | ||
| 2741 | @ignore | ||
| 2742 | @defvar unread-command-char | ||
| 2743 | This variable holds a character to be read as command input. | ||
| 2744 | A value of -1 means ``empty''. | ||
| 2745 | |||
| 2746 | This variable is mostly obsolete now that you can use | ||
| 2747 | @code{unread-command-events} instead; it exists only to support programs | ||
| 2748 | written for Emacs versions 18 and earlier. | ||
| 2749 | @end defvar | ||
| 2750 | @end ignore | ||
| 2751 | |||
| 2752 | @defun input-pending-p | 2741 | @defun input-pending-p |
| 2753 | @cindex waiting for command key input | 2742 | @cindex waiting for command key input |
| 2754 | This function determines whether any command input is currently | 2743 | This function determines whether any command input is currently |
diff --git a/doc/lispref/debugging.texi b/doc/lispref/debugging.texi index 00e8d84e9b3..5aeff576d09 100644 --- a/doc/lispref/debugging.texi +++ b/doc/lispref/debugging.texi | |||
| @@ -298,6 +298,11 @@ of @code{(debug)} isn't ignored, it will alter the execution of the | |||
| 298 | program!) The most common suitable places are inside a @code{progn} or | 298 | program!) The most common suitable places are inside a @code{progn} or |
| 299 | an implicit @code{progn} (@pxref{Sequencing}). | 299 | an implicit @code{progn} (@pxref{Sequencing}). |
| 300 | 300 | ||
| 301 | If you don't know exactly where in the source code you want to put | ||
| 302 | the debug statement, but you want to display a backtrace when a | ||
| 303 | certain message is displayed, you can set @code{debug-on-message} to a | ||
| 304 | regular expression matching the desired message. | ||
| 305 | |||
| 301 | @node Using Debugger | 306 | @node Using Debugger |
| 302 | @subsection Using the Debugger | 307 | @subsection Using the Debugger |
| 303 | 308 | ||
diff --git a/doc/lispref/eval.texi b/doc/lispref/eval.texi index 6dc6287b803..b373ecfbe62 100644 --- a/doc/lispref/eval.texi +++ b/doc/lispref/eval.texi | |||
| @@ -40,6 +40,7 @@ interpreter. | |||
| 40 | @cindex form | 40 | @cindex form |
| 41 | @cindex expression | 41 | @cindex expression |
| 42 | @cindex S-expression | 42 | @cindex S-expression |
| 43 | @cindex sexp | ||
| 43 | A Lisp object that is intended for evaluation is called a @dfn{form} | 44 | A Lisp object that is intended for evaluation is called a @dfn{form} |
| 44 | or @dfn{expression}@footnote{It is sometimes also referred to as an | 45 | or @dfn{expression}@footnote{It is sometimes also referred to as an |
| 45 | @dfn{S-expression} or @dfn{sexp}, but we generally do not use this | 46 | @dfn{S-expression} or @dfn{sexp}, but we generally do not use this |
diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index 023f8ba18dd..d685ce0aa74 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi | |||
| @@ -1293,14 +1293,19 @@ compare @var{object} against the elements of the list. For example: | |||
| 1293 | @defun delq object list | 1293 | @defun delq object list |
| 1294 | @cindex deleting list elements | 1294 | @cindex deleting list elements |
| 1295 | This function destructively removes all elements @code{eq} to | 1295 | This function destructively removes all elements @code{eq} to |
| 1296 | @var{object} from @var{list}. The letter @samp{q} in @code{delq} says | 1296 | @var{object} from @var{list}, and returns the resulting list. The |
| 1297 | that it uses @code{eq} to compare @var{object} against the elements of | 1297 | letter @samp{q} in @code{delq} says that it uses @code{eq} to compare |
| 1298 | the list, like @code{memq} and @code{remq}. | 1298 | @var{object} against the elements of the list, like @code{memq} and |
| 1299 | @code{remq}. | ||
| 1300 | |||
| 1301 | Typically, when you invoke @code{delq}, you should use the return | ||
| 1302 | value by assigning it to the variable which held the original list. | ||
| 1303 | The reason for this is explained below. | ||
| 1299 | @end defun | 1304 | @end defun |
| 1300 | 1305 | ||
| 1301 | When @code{delq} deletes elements from the front of the list, it does so | 1306 | The @code{delq} function deletes elements from the front of the list |
| 1302 | simply by advancing down the list and returning a sublist that starts | 1307 | by simply advancing down the list, and returning a sublist that starts |
| 1303 | after those elements: | 1308 | after those elements. For example: |
| 1304 | 1309 | ||
| 1305 | @example | 1310 | @example |
| 1306 | @group | 1311 | @group |
| @@ -1308,6 +1313,7 @@ after those elements: | |||
| 1308 | @end group | 1313 | @end group |
| 1309 | @end example | 1314 | @end example |
| 1310 | 1315 | ||
| 1316 | @noindent | ||
| 1311 | When an element to be deleted appears in the middle of the list, | 1317 | When an element to be deleted appears in the middle of the list, |
| 1312 | removing it involves changing the @sc{cdr}s (@pxref{Setcdr}). | 1318 | removing it involves changing the @sc{cdr}s (@pxref{Setcdr}). |
| 1313 | 1319 | ||
| @@ -1432,12 +1438,15 @@ Compare this with @code{memq}: | |||
| 1432 | @end defun | 1438 | @end defun |
| 1433 | 1439 | ||
| 1434 | @defun delete object sequence | 1440 | @defun delete object sequence |
| 1435 | If @code{sequence} is a list, this function destructively removes all | 1441 | This function removes all elements @code{equal} to @var{object} from |
| 1436 | elements @code{equal} to @var{object} from @var{sequence}. For lists, | 1442 | @var{sequence}, and returns the resulting sequence. |
| 1437 | @code{delete} is to @code{delq} as @code{member} is to @code{memq}: it | 1443 | |
| 1438 | uses @code{equal} to compare elements with @var{object}, like | 1444 | If @var{sequence} is a list, @code{delete} is to @code{delq} as |
| 1439 | @code{member}; when it finds an element that matches, it cuts the | 1445 | @code{member} is to @code{memq}: it uses @code{equal} to compare |
| 1440 | element out just as @code{delq} would. | 1446 | elements with @var{object}, like @code{member}; when it finds an |
| 1447 | element that matches, it cuts the element out just as @code{delq} | ||
| 1448 | would. As with @code{delq}, you should typically use the return value | ||
| 1449 | by assigning it to the variable which held the original list. | ||
| 1441 | 1450 | ||
| 1442 | If @code{sequence} is a vector or string, @code{delete} returns a copy | 1451 | If @code{sequence} is a vector or string, @code{delete} returns a copy |
| 1443 | of @code{sequence} with all elements @code{equal} to @code{object} | 1452 | of @code{sequence} with all elements @code{equal} to @code{object} |
diff --git a/doc/lispref/markers.texi b/doc/lispref/markers.texi index 22e806defec..80136f2e6f4 100644 --- a/doc/lispref/markers.texi +++ b/doc/lispref/markers.texi | |||
| @@ -355,9 +355,9 @@ the current buffer. | |||
| 355 | 355 | ||
| 356 | If @var{position} is less than 1, @code{set-marker} moves @var{marker} | 356 | If @var{position} is less than 1, @code{set-marker} moves @var{marker} |
| 357 | to the beginning of the buffer. If @var{position} is greater than the | 357 | to the beginning of the buffer. If @var{position} is greater than the |
| 358 | size of the buffer, @code{set-marker} moves marker to the end of the | 358 | size of the buffer (@pxref{Point}), @code{set-marker} moves marker to |
| 359 | buffer. If @var{position} is @code{nil} or a marker that points | 359 | the end of the buffer. If @var{position} is @code{nil} or a marker |
| 360 | nowhere, then @var{marker} is set to point nowhere. | 360 | that points nowhere, then @var{marker} is set to point nowhere. |
| 361 | 361 | ||
| 362 | The value returned is @var{marker}. | 362 | The value returned is @var{marker}. |
| 363 | 363 | ||
diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 4cf096b8663..3d6e80bf3f0 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi | |||
| @@ -1888,47 +1888,14 @@ Echo Area}), which uses the same screen space as the minibuffer. The | |||
| 1888 | cursor moves to the echo area while the question is being asked. | 1888 | cursor moves to the echo area while the question is being asked. |
| 1889 | 1889 | ||
| 1890 | The answers and their meanings, even @samp{y} and @samp{n}, are not | 1890 | The answers and their meanings, even @samp{y} and @samp{n}, are not |
| 1891 | hardwired. The keymap @code{query-replace-map} specifies them. | 1891 | hardwired, and are specified by the keymap @code{query-replace-map} |
| 1892 | @xref{Search and Replace}. | 1892 | (@pxref{Search and Replace}). In particular, if the user enters the |
| 1893 | 1893 | special responses @code{recenter}, @code{scroll-up}, | |
| 1894 | In the following example, the user first types @kbd{q}, which is | 1894 | @code{scroll-down}, @code{scroll-other-window}, or |
| 1895 | invalid. At the next prompt the user types @kbd{y}. | 1895 | @code{scroll-other-window-down} (respectively bound to @kbd{C-l}, |
| 1896 | 1896 | @kbd{C-v}, @kbd{M-v}, @kbd{C-M-v} and @kbd{C-M-S-v} in | |
| 1897 | @c Need an interactive example, because otherwise the return value | 1897 | @code{query-replace-map}), this function performs the specified window |
| 1898 | @c obscures the display of the valid answer. | 1898 | recentering or scrolling operation, and poses the question again. |
| 1899 | @smallexample | ||
| 1900 | @group | ||
| 1901 | (defun ask () | ||
| 1902 | (interactive) | ||
| 1903 | (y-or-n-p "Do you need a lift? ")) | ||
| 1904 | |||
| 1905 | ;; @r{After evaluation of the preceding definition, @kbd{M-x ask}} | ||
| 1906 | ;; @r{causes the following prompt to appear in the echo area:} | ||
| 1907 | @end group | ||
| 1908 | |||
| 1909 | @group | ||
| 1910 | ---------- Echo area ---------- | ||
| 1911 | Do you need a lift? (y or n) | ||
| 1912 | ---------- Echo area ---------- | ||
| 1913 | @end group | ||
| 1914 | |||
| 1915 | ;; @r{If the user then types @kbd{q}, the following appears:} | ||
| 1916 | |||
| 1917 | @group | ||
| 1918 | ---------- Echo area ---------- | ||
| 1919 | Please answer y or n. Do you need a lift? (y or n) | ||
| 1920 | ---------- Echo area ---------- | ||
| 1921 | @end group | ||
| 1922 | |||
| 1923 | ;; @r{When the user types a valid answer,} | ||
| 1924 | ;; @r{it is displayed after the question:} | ||
| 1925 | |||
| 1926 | @group | ||
| 1927 | ---------- Echo area ---------- | ||
| 1928 | Do you need a lift? (y or n) y | ||
| 1929 | ---------- Echo area ---------- | ||
| 1930 | @end group | ||
| 1931 | @end smallexample | ||
| 1932 | 1899 | ||
| 1933 | @noindent | 1900 | @noindent |
| 1934 | We show successive lines of echo area messages, but only one actually | 1901 | We show successive lines of echo area messages, but only one actually |
diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi index 17f3ee099bd..7c9672a38c0 100644 --- a/doc/lispref/numbers.texi +++ b/doc/lispref/numbers.texi | |||
| @@ -196,6 +196,14 @@ numerical functions return such values in cases where there is no | |||
| 196 | correct answer. For example, @code{(/ 0.0 0.0)} returns a NaN. (NaN | 196 | correct answer. For example, @code{(/ 0.0 0.0)} returns a NaN. (NaN |
| 197 | values can also carry a sign, but for practical purposes there's no | 197 | values can also carry a sign, but for practical purposes there's no |
| 198 | significant difference between different NaN values in Emacs Lisp.) | 198 | significant difference between different NaN values in Emacs Lisp.) |
| 199 | |||
| 200 | When a function is documented to return a NaN, it returns an | ||
| 201 | implementation-defined value when Emacs is running on one of the | ||
| 202 | now-rare platforms that do not use @acronym{IEEE} floating point. For | ||
| 203 | example, @code{(log -1.0)} typically returns a NaN, but on | ||
| 204 | non-@acronym{IEEE} platforms it returns an implementation-defined | ||
| 205 | value. | ||
| 206 | |||
| 199 | Here are the read syntaxes for these special floating point values: | 207 | Here are the read syntaxes for these special floating point values: |
| 200 | 208 | ||
| 201 | @table @asis | 209 | @table @asis |
| @@ -241,7 +249,7 @@ numbers. | |||
| 241 | 249 | ||
| 242 | @defun logb number | 250 | @defun logb number |
| 243 | This function returns the binary exponent of @var{number}. More | 251 | This function returns the binary exponent of @var{number}. More |
| 244 | precisely, the value is the logarithm of @var{number} base 2, rounded | 252 | precisely, the value is the logarithm of |@var{number}| base 2, rounded |
| 245 | down to an integer. | 253 | down to an integer. |
| 246 | 254 | ||
| 247 | @example | 255 | @example |
| @@ -694,7 +702,8 @@ arguments. It also permits floating point arguments; it rounds the | |||
| 694 | quotient downward (towards minus infinity) to an integer, and uses that | 702 | quotient downward (towards minus infinity) to an integer, and uses that |
| 695 | quotient to compute the remainder. | 703 | quotient to compute the remainder. |
| 696 | 704 | ||
| 697 | An @code{arith-error} results if @var{divisor} is 0. | 705 | If @var{divisor} is zero, @code{mod} signals an @code{arith-error} |
| 706 | error if both arguments are integers, and returns a NaN otherwise. | ||
| 698 | 707 | ||
| 699 | @example | 708 | @example |
| 700 | @group | 709 | @group |
| @@ -1096,8 +1105,8 @@ pi/2 | |||
| 1096 | @tex | 1105 | @tex |
| 1097 | @math{\pi/2} | 1106 | @math{\pi/2} |
| 1098 | @end tex | 1107 | @end tex |
| 1099 | (inclusive) whose sine is @var{arg}; if, however, @var{arg} is out of | 1108 | (inclusive) whose sine is @var{arg}. If @var{arg} is out of range |
| 1100 | range (outside [@minus{}1, 1]), it signals a @code{domain-error} error. | 1109 | (outside [@minus{}1, 1]), @code{asin} returns a NaN. |
| 1101 | @end defun | 1110 | @end defun |
| 1102 | 1111 | ||
| 1103 | @defun acos arg | 1112 | @defun acos arg |
| @@ -1108,8 +1117,8 @@ pi | |||
| 1108 | @tex | 1117 | @tex |
| 1109 | @math{\pi} | 1118 | @math{\pi} |
| 1110 | @end tex | 1119 | @end tex |
| 1111 | (inclusive) whose cosine is @var{arg}; if, however, @var{arg} is out | 1120 | (inclusive) whose cosine is @var{arg}. If @var{arg} is out of range |
| 1112 | of range (outside [@minus{}1, 1]), it signals a @code{domain-error} error. | 1121 | (outside [@minus{}1, 1]), @code{acos} returns a NaN. |
| 1113 | @end defun | 1122 | @end defun |
| 1114 | 1123 | ||
| 1115 | @defun atan y &optional x | 1124 | @defun atan y &optional x |
| @@ -1141,8 +1150,8 @@ This is the exponential function; it returns @math{e} to the power | |||
| 1141 | @defun log arg &optional base | 1150 | @defun log arg &optional base |
| 1142 | This function returns the logarithm of @var{arg}, with base | 1151 | This function returns the logarithm of @var{arg}, with base |
| 1143 | @var{base}. If you don't specify @var{base}, the natural base | 1152 | @var{base}. If you don't specify @var{base}, the natural base |
| 1144 | @math{e} is used. If @var{arg} is negative, it signals a | 1153 | @math{e} is used. If @var{arg} or @var{base} is negative, @code{log} |
| 1145 | @code{domain-error} error. | 1154 | returns a NaN. |
| 1146 | @end defun | 1155 | @end defun |
| 1147 | 1156 | ||
| 1148 | @ignore | 1157 | @ignore |
| @@ -1160,21 +1169,21 @@ lose accuracy. | |||
| 1160 | @end ignore | 1169 | @end ignore |
| 1161 | 1170 | ||
| 1162 | @defun log10 arg | 1171 | @defun log10 arg |
| 1163 | This function returns the logarithm of @var{arg}, with base 10. If | 1172 | This function returns the logarithm of @var{arg}, with base 10: |
| 1164 | @var{arg} is negative, it signals a @code{domain-error} error. | 1173 | @code{(log10 @var{x})} @equiv{} @code{(log @var{x} 10)}. |
| 1165 | @code{(log10 @var{x})} @equiv{} @code{(log @var{x} 10)}, at least | ||
| 1166 | approximately. | ||
| 1167 | @end defun | 1174 | @end defun |
| 1168 | 1175 | ||
| 1169 | @defun expt x y | 1176 | @defun expt x y |
| 1170 | This function returns @var{x} raised to power @var{y}. If both | 1177 | This function returns @var{x} raised to power @var{y}. If both |
| 1171 | arguments are integers and @var{y} is positive, the result is an | 1178 | arguments are integers and @var{y} is positive, the result is an |
| 1172 | integer; in this case, overflow causes truncation, so watch out. | 1179 | integer; in this case, overflow causes truncation, so watch out. |
| 1180 | If @var{x} is a finite negative number and @var{y} is a finite | ||
| 1181 | non-integer, @code{expt} returns a NaN. | ||
| 1173 | @end defun | 1182 | @end defun |
| 1174 | 1183 | ||
| 1175 | @defun sqrt arg | 1184 | @defun sqrt arg |
| 1176 | This returns the square root of @var{arg}. If @var{arg} is negative, | 1185 | This returns the square root of @var{arg}. If @var{arg} is negative, |
| 1177 | it signals a @code{domain-error} error. | 1186 | @code{sqrt} returns a NaN. |
| 1178 | @end defun | 1187 | @end defun |
| 1179 | 1188 | ||
| 1180 | In addition, Emacs defines the following common mathematical | 1189 | In addition, Emacs defines the following common mathematical |
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, |
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 0fa681ecb51..edd1d30e28d 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi | |||
| @@ -1796,7 +1796,13 @@ Delete the text being considered, then enter a recursive edit to replace | |||
| 1796 | it. | 1796 | it. |
| 1797 | 1797 | ||
| 1798 | @item recenter | 1798 | @item recenter |
| 1799 | Redisplay and center the window, then ask the same question again. | 1799 | @itemx scroll-up |
| 1800 | @itemx scroll-down | ||
| 1801 | @itemx scroll-other-window | ||
| 1802 | @itemx scroll-other-window-down | ||
| 1803 | Perform the specified window scroll operation, then ask the same | ||
| 1804 | question again. Only @code{y-or-n-p} and related functions use this | ||
| 1805 | answer. | ||
| 1800 | 1806 | ||
| 1801 | @item quit | 1807 | @item quit |
| 1802 | Perform a quit right away. Only @code{y-or-n-p} and related functions | 1808 | Perform a quit right away. Only @code{y-or-n-p} and related functions |
diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index ab685290901..624b5a92d6e 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi | |||
| @@ -130,6 +130,10 @@ comment-ender), and the entry for @samp{/} is @samp{@w{. 14}} (i.e., | |||
| 130 | punctuation, matching character slot unused, first character of a | 130 | punctuation, matching character slot unused, first character of a |
| 131 | comment-starter, second character of a comment-ender). | 131 | comment-starter, second character of a comment-ender). |
| 132 | 132 | ||
| 133 | Emacs also defines @dfn{raw syntax descriptors}, which are used to | ||
| 134 | describe syntax classes at a lower level. @xref{Syntax Table | ||
| 135 | Internals}. | ||
| 136 | |||
| 133 | @menu | 137 | @menu |
| 134 | * Syntax Class Table:: Table of syntax classes. | 138 | * Syntax Class Table:: Table of syntax classes. |
| 135 | * Syntax Flags:: Additional flags each character can have. | 139 | * Syntax Flags:: Additional flags each character can have. |
| @@ -531,8 +535,9 @@ the current buffer's syntax table to determine the syntax for the | |||
| 531 | underlying text character. | 535 | underlying text character. |
| 532 | 536 | ||
| 533 | @item @code{(@var{syntax-code} . @var{matching-char})} | 537 | @item @code{(@var{syntax-code} . @var{matching-char})} |
| 534 | A cons cell of this format specifies the syntax for the underlying | 538 | A cons cell of this format is a raw syntax descriptor (@pxref{Syntax |
| 535 | text character. (@pxref{Syntax Table Internals}) | 539 | Table Internals}), which directly specifies a syntax class for the |
| 540 | underlying text character. | ||
| 536 | 541 | ||
| 537 | @item @code{nil} | 542 | @item @code{nil} |
| 538 | If the property is @code{nil}, the character's syntax is determined from | 543 | If the property is @code{nil}, the character's syntax is determined from |
| @@ -878,6 +883,9 @@ This function parses a sexp in the current buffer starting at | |||
| 878 | @var{start}, not scanning past @var{limit}. It stops at position | 883 | @var{start}, not scanning past @var{limit}. It stops at position |
| 879 | @var{limit} or when certain criteria described below are met, and sets | 884 | @var{limit} or when certain criteria described below are met, and sets |
| 880 | point to the location where parsing stops. It returns a parser state | 885 | point to the location where parsing stops. It returns a parser state |
| 886 | @ifinfo | ||
| 887 | (@pxref{Parser State}) | ||
| 888 | @end ifinfo | ||
| 881 | describing the status of the parse at the point where it stops. | 889 | describing the status of the parse at the point where it stops. |
| 882 | 890 | ||
| 883 | @cindex parenthesis depth | 891 | @cindex parenthesis depth |
| @@ -937,16 +945,20 @@ documented in this section. This internal format can also be assigned | |||
| 937 | as syntax properties (@pxref{Syntax Properties}). | 945 | as syntax properties (@pxref{Syntax Properties}). |
| 938 | 946 | ||
| 939 | @cindex syntax code | 947 | @cindex syntax code |
| 940 | Each entry in a syntax table is a cons cell of the form | 948 | @cindex raw syntax descriptor |
| 941 | @code{(@var{syntax-code} . @var{matching-char})}. @var{syntax-code} | 949 | Each entry in a syntax table is a @dfn{raw syntax descriptor}: a |
| 942 | is an integer that encodes the syntax class and syntax flags, | 950 | cons cell of the form @code{(@var{syntax-code} |
| 943 | according to the table below. @var{matching-char}, if non-@code{nil}, | 951 | . @var{matching-char})}. @var{syntax-code} is an integer which |
| 944 | specifies a matching character (similar to the second character in a | 952 | encodes the syntax class and syntax flags, according to the table |
| 945 | syntax descriptor). | 953 | below. @var{matching-char}, if non-@code{nil}, specifies a matching |
| 954 | character (similar to the second character in a syntax descriptor). | ||
| 955 | |||
| 956 | Here are the syntax codes corresponding to the various syntax | ||
| 957 | classes: | ||
| 946 | 958 | ||
| 947 | @multitable @columnfractions .2 .3 .2 .3 | 959 | @multitable @columnfractions .2 .3 .2 .3 |
| 948 | @item | 960 | @item |
| 949 | @i{Syntax code} @tab @i{Class} @tab @i{Syntax code} @tab @i{Class} | 961 | @i{Code} @tab @i{Class} @tab @i{Code} @tab @i{Class} |
| 950 | @item | 962 | @item |
| 951 | 0 @tab whitespace @tab 8 @tab paired delimiter | 963 | 0 @tab whitespace @tab 8 @tab paired delimiter |
| 952 | @item | 964 | @item |
| @@ -967,7 +979,7 @@ syntax descriptor). | |||
| 967 | 979 | ||
| 968 | @noindent | 980 | @noindent |
| 969 | For example, in the standard syntax table, the entry for @samp{(} is | 981 | For example, in the standard syntax table, the entry for @samp{(} is |
| 970 | @code{(4 . 41)}. (41 is the character code for @samp{)}.) | 982 | @code{(4 . 41)}. 41 is the character code for @samp{)}. |
| 971 | 983 | ||
| 972 | Syntax flags are encoded in higher order bits, starting 16 bits from | 984 | Syntax flags are encoded in higher order bits, starting 16 bits from |
| 973 | the least significant bit. This table gives the power of two which | 985 | the least significant bit. This table gives the power of two which |
| @@ -987,33 +999,35 @@ corresponds to each syntax flag. | |||
| 987 | @end multitable | 999 | @end multitable |
| 988 | 1000 | ||
| 989 | @defun string-to-syntax @var{desc} | 1001 | @defun string-to-syntax @var{desc} |
| 990 | Given a syntax descriptor @var{desc}, this function returns the | 1002 | Given a syntax descriptor @var{desc} (a string), this function returns |
| 991 | corresponding internal form, a cons cell @code{(@var{syntax-code} | 1003 | the corresponding raw syntax descriptor. |
| 992 | . @var{matching-char})}. | ||
| 993 | @end defun | 1004 | @end defun |
| 994 | 1005 | ||
| 995 | @defun syntax-after pos | 1006 | @defun syntax-after pos |
| 996 | This function returns the syntax code of the character in the buffer | 1007 | This function returns the raw syntax descriptor for the character in |
| 997 | after position @var{pos}, taking account of syntax properties as well | 1008 | the buffer after position @var{pos}, taking account of syntax |
| 998 | as the syntax table. If @var{pos} is outside the buffer's accessible | 1009 | properties as well as the syntax table. If @var{pos} is outside the |
| 999 | portion (@pxref{Narrowing, accessible portion}), this function returns | 1010 | buffer's accessible portion (@pxref{Narrowing, accessible portion}), |
| 1000 | @code{nil}. | 1011 | the return value is @code{nil}. |
| 1001 | @end defun | 1012 | @end defun |
| 1002 | 1013 | ||
| 1003 | @defun syntax-class syntax | 1014 | @defun syntax-class syntax |
| 1004 | This function returns the syntax class of the syntax code | 1015 | This function returns the syntax code for the raw syntax descriptor |
| 1005 | @var{syntax}. (It masks off the high 16 bits that hold the flags | 1016 | @var{syntax}. More precisely, it takes the raw syntax descriptor's |
| 1006 | encoded in the syntax descriptor.) If @var{syntax} is @code{nil}, it | 1017 | @var{syntax-code} component, masks off the high 16 bits which record |
| 1007 | returns @code{nil}; this is so evaluating the expression | 1018 | the syntax flags, and returns the resulting integer. |
| 1019 | |||
| 1020 | If @var{syntax} is @code{nil}, the return value is returns @code{nil}. | ||
| 1021 | This is so that the expression | ||
| 1008 | 1022 | ||
| 1009 | @example | 1023 | @example |
| 1010 | (syntax-class (syntax-after pos)) | 1024 | (syntax-class (syntax-after pos)) |
| 1011 | @end example | 1025 | @end example |
| 1012 | 1026 | ||
| 1013 | @noindent | 1027 | @noindent |
| 1014 | where @code{pos} is outside the buffer's accessible portion, will | 1028 | evaluates to @code{nil} if @code{pos} is outside the buffer's |
| 1015 | yield @code{nil} without throwing errors or producing wrong syntax | 1029 | accessible portion, without throwing errors or returning an incorrect |
| 1016 | class codes. | 1030 | code. |
| 1017 | @end defun | 1031 | @end defun |
| 1018 | 1032 | ||
| 1019 | @node Categories | 1033 | @node Categories |
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 3b078e7e19f..c5b66757ace 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -1302,9 +1302,10 @@ This returns @code{t} if @var{variable} is buffer-local in buffer | |||
| 1302 | @end defun | 1302 | @end defun |
| 1303 | 1303 | ||
| 1304 | @defun local-variable-if-set-p variable &optional buffer | 1304 | @defun local-variable-if-set-p variable &optional buffer |
| 1305 | This returns @code{t} if @var{variable} will become buffer-local in | 1305 | This returns @code{t} if @var{variable} either has a buffer-local |
| 1306 | buffer @var{buffer} (which defaults to the current buffer) if it is | 1306 | value in buffer @var{buffer}, or is automatically buffer-local. |
| 1307 | set there. | 1307 | Otherwise, it returns @code{nil}. If omitted or @code{nil}, |
| 1308 | @var{buffer} defaults to the current buffer. | ||
| 1308 | @end defun | 1309 | @end defun |
| 1309 | 1310 | ||
| 1310 | @defun buffer-local-value variable buffer | 1311 | @defun buffer-local-value variable buffer |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 5fe007ba02d..ea48a46359c 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -1492,12 +1492,10 @@ to make a buffer current to modify it in Lisp, use | |||
| 1492 | @code{set-buffer}. @xref{Current Buffer}. | 1492 | @code{set-buffer}. @xref{Current Buffer}. |
| 1493 | 1493 | ||
| 1494 | @deffn Command switch-to-buffer buffer-or-name &optional norecord force-same-window | 1494 | @deffn Command switch-to-buffer buffer-or-name &optional norecord force-same-window |
| 1495 | This function displays @var{buffer-or-name} in the selected window, | 1495 | This command attempts to display @var{buffer-or-name} in the selected |
| 1496 | and makes it the current buffer. (In contrast, @code{set-buffer} | 1496 | window, and makes it the current buffer. It is often used |
| 1497 | makes the buffer current but does not display it; @pxref{Current | 1497 | interactively (as the binding of @kbd{C-x b}), as well as in Lisp |
| 1498 | Buffer}). It is often used interactively (as the binding of @kbd{C-x | 1498 | programs. The return value is the buffer switched to. |
| 1499 | b}), as well as in Lisp programs. The return value is the buffer | ||
| 1500 | switched to. | ||
| 1501 | 1499 | ||
| 1502 | If @var{buffer-or-name} is @code{nil}, it defaults to the buffer | 1500 | If @var{buffer-or-name} is @code{nil}, it defaults to the buffer |
| 1503 | returned by @code{other-buffer} (@pxref{The Buffer List}). If | 1501 | returned by @code{other-buffer} (@pxref{The Buffer List}). If |
| @@ -1506,17 +1504,18 @@ buffer, this function creates a new buffer with that name; the new | |||
| 1506 | buffer's major mode is determined by the variable @code{major-mode} | 1504 | buffer's major mode is determined by the variable @code{major-mode} |
| 1507 | (@pxref{Major Modes}). | 1505 | (@pxref{Major Modes}). |
| 1508 | 1506 | ||
| 1509 | Normally the specified buffer is put at the front of the buffer | 1507 | Normally, the specified buffer is put at the front of the buffer |
| 1510 | list---both the global buffer list and the selected frame's buffer | 1508 | list---both the global buffer list and the selected frame's buffer |
| 1511 | list (@pxref{The Buffer List}). However, this is not done if the | 1509 | list (@pxref{The Buffer List}). However, this is not done if the |
| 1512 | optional argument @var{norecord} is non-@code{nil}. | 1510 | optional argument @var{norecord} is non-@code{nil}. |
| 1513 | 1511 | ||
| 1514 | If this function is unable to display the buffer in the selected | 1512 | Sometimes, @code{switch-to-buffer} may be unable to display the buffer |
| 1515 | window---usually because the selected window is a minibuffer window or | 1513 | in the selected window. This happens if the selected window is a |
| 1516 | is strongly dedicated to its buffer (@pxref{Dedicated Windows})---then | 1514 | minibuffer window, or if the selected window is strongly dedicated to |
| 1517 | it normally tries to display the buffer in some other window, in the | 1515 | its buffer (@pxref{Dedicated Windows}). In that case, the command |
| 1518 | manner of @code{pop-to-buffer} (see below). However, if the optional | 1516 | normally tries to display the buffer in some other window, by invoking |
| 1519 | argument @var{force-same-window} is non-@code{nil}, it signals an error | 1517 | @code{pop-to-buffer} (see below). However, if the optional argument |
| 1518 | @var{force-same-window} is non-@code{nil}, it signals an error | ||
| 1520 | instead. | 1519 | instead. |
| 1521 | @end deffn | 1520 | @end deffn |
| 1522 | 1521 | ||
| @@ -1728,8 +1727,7 @@ A frame means consider windows on that frame only. | |||
| 1728 | @end itemize | 1727 | @end itemize |
| 1729 | 1728 | ||
| 1730 | If @var{alist} contains no @code{reusable-frames} entry, this function | 1729 | If @var{alist} contains no @code{reusable-frames} entry, this function |
| 1731 | normally searches just the selected frame; however, if either the | 1730 | normally searches just the selected frame; however, if the variable |
| 1732 | variable @code{display-buffer-reuse-frames} or the variable | ||
| 1733 | @code{pop-up-frames} is non-@code{nil}, it searches all frames on the | 1731 | @code{pop-up-frames} is non-@code{nil}, it searches all frames on the |
| 1734 | current terminal. @xref{Choosing Window Options}. | 1732 | current terminal. @xref{Choosing Window Options}. |
| 1735 | 1733 | ||
| @@ -1769,14 +1767,6 @@ The behavior of the standard display actions of @code{display-buffer} | |||
| 1769 | (@pxref{Choosing Window}) can be modified by a variety of user | 1767 | (@pxref{Choosing Window}) can be modified by a variety of user |
| 1770 | options. | 1768 | options. |
| 1771 | 1769 | ||
| 1772 | @defopt display-buffer-reuse-frames | ||
| 1773 | If the value of this variable is non-@code{nil}, @code{display-buffer} | ||
| 1774 | may search all frames on the current terminal when looking for a | ||
| 1775 | window already displaying the specified buffer. The default is | ||
| 1776 | @code{nil}. This variable is consulted by the action function | ||
| 1777 | @code{display-buffer-reuse-window} (@pxref{Display Action Functions}). | ||
| 1778 | @end defopt | ||
| 1779 | |||
| 1780 | @defopt pop-up-windows | 1770 | @defopt pop-up-windows |
| 1781 | If the value of this variable is non-@code{nil}, @code{display-buffer} | 1771 | If the value of this variable is non-@code{nil}, @code{display-buffer} |
| 1782 | is allowed to split an existing window to make a new window for | 1772 | is allowed to split an existing window to make a new window for |