aboutsummaryrefslogtreecommitdiffstats
path: root/doc/lispref
diff options
context:
space:
mode:
authorDaniel Colascione2012-09-17 04:07:36 -0800
committerDaniel Colascione2012-09-17 04:07:36 -0800
commit2ab329f3b5d52a39f0a45c3d9c129f1c19560142 (patch)
tree6dd6784d63e54cb18071df8e28fbdbc27d418728 /doc/lispref
parentf701ab72dd55460d23c8b029550aa4d7ecef3cfa (diff)
parentbb7dce392f6d9d5fc4b9d7de09ff920a52f07669 (diff)
downloademacs-2ab329f3b5d52a39f0a45c3d9c129f1c19560142.tar.gz
emacs-2ab329f3b5d52a39f0a45c3d9c129f1c19560142.zip
Merge from trunk
Diffstat (limited to 'doc/lispref')
-rw-r--r--doc/lispref/ChangeLog53
-rw-r--r--doc/lispref/commands.texi11
-rw-r--r--doc/lispref/debugging.texi5
-rw-r--r--doc/lispref/eval.texi1
-rw-r--r--doc/lispref/lists.texi33
-rw-r--r--doc/lispref/markers.texi6
-rw-r--r--doc/lispref/minibuf.texi49
-rw-r--r--doc/lispref/numbers.texi35
-rw-r--r--doc/lispref/positions.texi29
-rw-r--r--doc/lispref/searching.texi8
-rw-r--r--doc/lispref/syntax.texi64
-rw-r--r--doc/lispref/variables.texi7
-rw-r--r--doc/lispref/windows.texi36
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 @@
12012-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
142012-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
252012-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
312012-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
502012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
51
52 * debugging.texi (Explicit Debug): Document `debug-on-message'.
53
12012-09-02 Chong Yidong <cyd@gnu.org> 542012-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
2738individual events, which you can put in @code{unread-command-events}. 2738individual 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
2743This variable holds a character to be read as command input.
2744A value of -1 means ``empty''.
2745
2746This variable is mostly obsolete now that you can use
2747@code{unread-command-events} instead; it exists only to support programs
2748written 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
2754This function determines whether any command input is currently 2743This 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
298program!) The most common suitable places are inside a @code{progn} or 298program!) The most common suitable places are inside a @code{progn} or
299an implicit @code{progn} (@pxref{Sequencing}). 299an implicit @code{progn} (@pxref{Sequencing}).
300 300
301 If you don't know exactly where in the source code you want to put
302the debug statement, but you want to display a backtrace when a
303certain message is displayed, you can set @code{debug-on-message} to a
304regular 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}
44or @dfn{expression}@footnote{It is sometimes also referred to as an 45or @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
1295This function destructively removes all elements @code{eq} to 1295This 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
1297that it uses @code{eq} to compare @var{object} against the elements of 1297letter @samp{q} in @code{delq} says that it uses @code{eq} to compare
1298the list, like @code{memq} and @code{remq}. 1298@var{object} against the elements of the list, like @code{memq} and
1299@code{remq}.
1300
1301Typically, when you invoke @code{delq}, you should use the return
1302value by assigning it to the variable which held the original list.
1303The reason for this is explained below.
1299@end defun 1304@end defun
1300 1305
1301When @code{delq} deletes elements from the front of the list, it does so 1306The @code{delq} function deletes elements from the front of the list
1302simply by advancing down the list and returning a sublist that starts 1307by simply advancing down the list, and returning a sublist that starts
1303after those elements: 1308after 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
1311When an element to be deleted appears in the middle of the list, 1317When an element to be deleted appears in the middle of the list,
1312removing it involves changing the @sc{cdr}s (@pxref{Setcdr}). 1318removing 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
1435If @code{sequence} is a list, this function destructively removes all 1441This function removes all elements @code{equal} to @var{object} from
1436elements @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
1438uses @code{equal} to compare elements with @var{object}, like 1444If @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
1440element out just as @code{delq} would. 1446elements with @var{object}, like @code{member}; when it finds an
1447element that matches, it cuts the element out just as @code{delq}
1448would. As with @code{delq}, you should typically use the return value
1449by assigning it to the variable which held the original list.
1441 1450
1442If @code{sequence} is a vector or string, @code{delete} returns a copy 1451If @code{sequence} is a vector or string, @code{delete} returns a copy
1443of @code{sequence} with all elements @code{equal} to @code{object} 1452of @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
356If @var{position} is less than 1, @code{set-marker} moves @var{marker} 356If @var{position} is less than 1, @code{set-marker} moves @var{marker}
357to the beginning of the buffer. If @var{position} is greater than the 357to the beginning of the buffer. If @var{position} is greater than the
358size of the buffer, @code{set-marker} moves marker to the end of the 358size of the buffer (@pxref{Point}), @code{set-marker} moves marker to
359buffer. If @var{position} is @code{nil} or a marker that points 359the end of the buffer. If @var{position} is @code{nil} or a marker
360nowhere, then @var{marker} is set to point nowhere. 360that points nowhere, then @var{marker} is set to point nowhere.
361 361
362The value returned is @var{marker}. 362The 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
1888cursor moves to the echo area while the question is being asked. 1888cursor moves to the echo area while the question is being asked.
1889 1889
1890The answers and their meanings, even @samp{y} and @samp{n}, are not 1890The answers and their meanings, even @samp{y} and @samp{n}, are not
1891hardwired. The keymap @code{query-replace-map} specifies them. 1891hardwired, 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 1893special responses @code{recenter}, @code{scroll-up},
1894In the following example, the user first types @kbd{q}, which is 1894@code{scroll-down}, @code{scroll-other-window}, or
1895invalid. 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. 1898recentering 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 ----------
1911Do 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 ----------
1919Please 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 ----------
1928Do you need a lift? (y or n) y
1929---------- Echo area ----------
1930@end group
1931@end smallexample
1932 1899
1933@noindent 1900@noindent
1934We show successive lines of echo area messages, but only one actually 1901We 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
196correct answer. For example, @code{(/ 0.0 0.0)} returns a NaN. (NaN 196correct answer. For example, @code{(/ 0.0 0.0)} returns a NaN. (NaN
197values can also carry a sign, but for practical purposes there's no 197values can also carry a sign, but for practical purposes there's no
198significant difference between different NaN values in Emacs Lisp.) 198significant difference between different NaN values in Emacs Lisp.)
199
200When a function is documented to return a NaN, it returns an
201implementation-defined value when Emacs is running on one of the
202now-rare platforms that do not use @acronym{IEEE} floating point. For
203example, @code{(log -1.0)} typically returns a NaN, but on
204non-@acronym{IEEE} platforms it returns an implementation-defined
205value.
206
199Here are the read syntaxes for these special floating point values: 207Here 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
243This function returns the binary exponent of @var{number}. More 251This function returns the binary exponent of @var{number}. More
244precisely, the value is the logarithm of @var{number} base 2, rounded 252precisely, the value is the logarithm of |@var{number}| base 2, rounded
245down to an integer. 253down to an integer.
246 254
247@example 255@example
@@ -694,7 +702,8 @@ arguments. It also permits floating point arguments; it rounds the
694quotient downward (towards minus infinity) to an integer, and uses that 702quotient downward (towards minus infinity) to an integer, and uses that
695quotient to compute the remainder. 703quotient to compute the remainder.
696 704
697An @code{arith-error} results if @var{divisor} is 0. 705If @var{divisor} is zero, @code{mod} signals an @code{arith-error}
706error 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
1100range (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
1112of 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
1142This function returns the logarithm of @var{arg}, with base 1151This 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. 1154returns 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
1163This function returns the logarithm of @var{arg}, with base 10. If 1172This 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
1166approximately.
1167@end defun 1174@end defun
1168 1175
1169@defun expt x y 1176@defun expt x y
1170This function returns @var{x} raised to power @var{y}. If both 1177This function returns @var{x} raised to power @var{y}. If both
1171arguments are integers and @var{y} is positive, the result is an 1178arguments are integers and @var{y} is positive, the result is an
1172integer; in this case, overflow causes truncation, so watch out. 1179integer; in this case, overflow causes truncation, so watch out.
1180If @var{x} is a finite negative number and @var{y} is a finite
1181non-integer, @code{expt} returns a NaN.
1173@end defun 1182@end defun
1174 1183
1175@defun sqrt arg 1184@defun sqrt arg
1176This returns the square root of @var{arg}. If @var{arg} is negative, 1185This returns the square root of @var{arg}. If @var{arg} is negative,
1177it signals a @code{domain-error} error. 1186@code{sqrt} returns a NaN.
1178@end defun 1187@end defun
1179 1188
1180In addition, Emacs defines the following common mathematical 1189In 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
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,
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
1796it. 1796it.
1797 1797
1798@item recenter 1798@item recenter
1799Redisplay 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
1803Perform the specified window scroll operation, then ask the same
1804question again. Only @code{y-or-n-p} and related functions use this
1805answer.
1800 1806
1801@item quit 1807@item quit
1802Perform a quit right away. Only @code{y-or-n-p} and related functions 1808Perform 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.,
130punctuation, matching character slot unused, first character of a 130punctuation, matching character slot unused, first character of a
131comment-starter, second character of a comment-ender). 131comment-starter, second character of a comment-ender).
132 132
133 Emacs also defines @dfn{raw syntax descriptors}, which are used to
134describe syntax classes at a lower level. @xref{Syntax Table
135Internals}.
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
531underlying text character. 535underlying text character.
532 536
533@item @code{(@var{syntax-code} . @var{matching-char})} 537@item @code{(@var{syntax-code} . @var{matching-char})}
534A cons cell of this format specifies the syntax for the underlying 538A cons cell of this format is a raw syntax descriptor (@pxref{Syntax
535text character. (@pxref{Syntax Table Internals}) 539Table Internals}), which directly specifies a syntax class for the
540underlying text character.
536 541
537@item @code{nil} 542@item @code{nil}
538If the property is @code{nil}, the character's syntax is determined from 543If 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
880point to the location where parsing stops. It returns a parser state 885point to the location where parsing stops. It returns a parser state
886@ifinfo
887(@pxref{Parser State})
888@end ifinfo
881describing the status of the parse at the point where it stops. 889describing 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
937as syntax properties (@pxref{Syntax Properties}). 945as 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
942is an integer that encodes the syntax class and syntax flags, 950cons cell of the form @code{(@var{syntax-code}
943according to the table below. @var{matching-char}, if non-@code{nil}, 951. @var{matching-char})}. @var{syntax-code} is an integer which
944specifies a matching character (similar to the second character in a 952encodes the syntax class and syntax flags, according to the table
945syntax descriptor). 953below. @var{matching-char}, if non-@code{nil}, specifies a matching
954character (similar to the second character in a syntax descriptor).
955
956 Here are the syntax codes corresponding to the various syntax
957classes:
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
9510 @tab whitespace @tab 8 @tab paired delimiter 9630 @tab whitespace @tab 8 @tab paired delimiter
952@item 964@item
@@ -967,7 +979,7 @@ syntax descriptor).
967 979
968@noindent 980@noindent
969For example, in the standard syntax table, the entry for @samp{(} is 981For 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
973the least significant bit. This table gives the power of two which 985the 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}
990Given a syntax descriptor @var{desc}, this function returns the 1002Given a syntax descriptor @var{desc} (a string), this function returns
991corresponding internal form, a cons cell @code{(@var{syntax-code} 1003the 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
996This function returns the syntax code of the character in the buffer 1007This function returns the raw syntax descriptor for the character in
997after position @var{pos}, taking account of syntax properties as well 1008the buffer after position @var{pos}, taking account of syntax
998as the syntax table. If @var{pos} is outside the buffer's accessible 1009properties as well as the syntax table. If @var{pos} is outside the
999portion (@pxref{Narrowing, accessible portion}), this function returns 1010buffer's accessible portion (@pxref{Narrowing, accessible portion}),
1000@code{nil}. 1011the return value is @code{nil}.
1001@end defun 1012@end defun
1002 1013
1003@defun syntax-class syntax 1014@defun syntax-class syntax
1004This function returns the syntax class of the syntax code 1015This 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
1006encoded in the syntax descriptor.) If @var{syntax} is @code{nil}, it 1017@var{syntax-code} component, masks off the high 16 bits which record
1007returns @code{nil}; this is so evaluating the expression 1018the syntax flags, and returns the resulting integer.
1019
1020If @var{syntax} is @code{nil}, the return value is returns @code{nil}.
1021This 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
1014where @code{pos} is outside the buffer's accessible portion, will 1028evaluates to @code{nil} if @code{pos} is outside the buffer's
1015yield @code{nil} without throwing errors or producing wrong syntax 1029accessible portion, without throwing errors or returning an incorrect
1016class codes. 1030code.
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
1305This returns @code{t} if @var{variable} will become buffer-local in 1305This returns @code{t} if @var{variable} either has a buffer-local
1306buffer @var{buffer} (which defaults to the current buffer) if it is 1306value in buffer @var{buffer}, or is automatically buffer-local.
1307set there. 1307Otherwise, 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
1495This function displays @var{buffer-or-name} in the selected window, 1495This command attempts to display @var{buffer-or-name} in the selected
1496and makes it the current buffer. (In contrast, @code{set-buffer} 1496window, and makes it the current buffer. It is often used
1497makes the buffer current but does not display it; @pxref{Current 1497interactively (as the binding of @kbd{C-x b}), as well as in Lisp
1498Buffer}). It is often used interactively (as the binding of @kbd{C-x 1498programs. The return value is the buffer switched to.
1499b}), as well as in Lisp programs. The return value is the buffer
1500switched to.
1501 1499
1502If @var{buffer-or-name} is @code{nil}, it defaults to the buffer 1500If @var{buffer-or-name} is @code{nil}, it defaults to the buffer
1503returned by @code{other-buffer} (@pxref{The Buffer List}). If 1501returned 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
1506buffer's major mode is determined by the variable @code{major-mode} 1504buffer's major mode is determined by the variable @code{major-mode}
1507(@pxref{Major Modes}). 1505(@pxref{Major Modes}).
1508 1506
1509Normally the specified buffer is put at the front of the buffer 1507Normally, the specified buffer is put at the front of the buffer
1510list---both the global buffer list and the selected frame's buffer 1508list---both the global buffer list and the selected frame's buffer
1511list (@pxref{The Buffer List}). However, this is not done if the 1509list (@pxref{The Buffer List}). However, this is not done if the
1512optional argument @var{norecord} is non-@code{nil}. 1510optional argument @var{norecord} is non-@code{nil}.
1513 1511
1514If this function is unable to display the buffer in the selected 1512Sometimes, @code{switch-to-buffer} may be unable to display the buffer
1515window---usually because the selected window is a minibuffer window or 1513in the selected window. This happens if the selected window is a
1516is strongly dedicated to its buffer (@pxref{Dedicated Windows})---then 1514minibuffer window, or if the selected window is strongly dedicated to
1517it normally tries to display the buffer in some other window, in the 1515its buffer (@pxref{Dedicated Windows}). In that case, the command
1518manner of @code{pop-to-buffer} (see below). However, if the optional 1516normally tries to display the buffer in some other window, by invoking
1519argument @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
1520instead. 1519instead.
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
1730If @var{alist} contains no @code{reusable-frames} entry, this function 1729If @var{alist} contains no @code{reusable-frames} entry, this function
1731normally searches just the selected frame; however, if either the 1730normally searches just the selected frame; however, if the variable
1732variable @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
1734current terminal. @xref{Choosing Window Options}. 1732current 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
1770options. 1768options.
1771 1769
1772@defopt display-buffer-reuse-frames
1773If the value of this variable is non-@code{nil}, @code{display-buffer}
1774may search all frames on the current terminal when looking for a
1775window 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
1781If the value of this variable is non-@code{nil}, @code{display-buffer} 1771If the value of this variable is non-@code{nil}, @code{display-buffer}
1782is allowed to split an existing window to make a new window for 1772is allowed to split an existing window to make a new window for