]> code.delx.au - gnu-emacs/blobdiff - doc/lispref/syntax.texi
Update copyright year to 2015
[gnu-emacs] / doc / lispref / syntax.texi
index 624b5a92d6e68bdc291ff74cf2f36523f41c8820..1f1dd6e8befbd1206569352b0a84afe244281825 100644 (file)
@@ -1,7 +1,7 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990-1995, 1998-1999, 2001-2012
-@c   Free Software Foundation, Inc.
+@c Copyright (C) 1990-1995, 1998-1999, 2001-2015 Free Software
+@c Foundation, Inc.
 @c See the file elisp.texi for copying conditions.
 @node Syntax Tables
 @chapter Syntax Tables
@@ -115,7 +115,7 @@ its arguments (@pxref{Syntax Table Functions}).
 
   The first character in a syntax descriptor must be a syntax class
 designator character.  The second character, if present, specifies a
-matching character (e.g.@: in Lisp, the matching character for
+matching character (e.g., in Lisp, the matching character for
 @samp{(} is @samp{)}); a space specifies that there is no matching
 character.  Then come characters specifying additional syntax
 properties (@pxref{Syntax Flags}).
@@ -141,6 +141,7 @@ Internals}.
 
 @node Syntax Class Table
 @subsection Table of Syntax Classes
+@cindex syntax class table
 
   Here is a table of syntax classes, the characters that designate
 them, their meanings, and examples of their use.
@@ -335,6 +336,7 @@ that this kind of comment can be nested.  For a two-character
 comment delimiter, @samp{n} on either character makes it
 nestable.
 
+@cindex comment style
 Emacs supports several comment styles simultaneously in any one syntax
 table.  A comment style is a set of flags @samp{b}, @samp{c}, and
 @samp{n}, so there can be up to 8 different comment styles.
@@ -397,7 +399,7 @@ non-@code{nil}, the parent of the new syntax table is @var{table};
 otherwise, the parent is the standard syntax table.
 
 In the new syntax table, all characters are initially given the
-``inherit'' (@samp{@@}) syntax class, i.e.@: their syntax is inherited
+``inherit'' (@samp{@@}) syntax class, i.e., their syntax is inherited
 from the parent table (@pxref{Syntax Class Table}).
 @end defun
 
@@ -409,6 +411,7 @@ is not a syntax table.
 @end defun
 
 @deffn Command modify-syntax-entry char syntax-descriptor  &optional table
+@cindex syntax entry, setting
 This function sets the syntax entry for @var{char} according to
 @var{syntax-descriptor}.  @var{char} must be a character, or a cons
 cell of the form @code{(@var{min} . @var{max})}; in the latter case,
@@ -418,7 +421,7 @@ between @var{min} and @var{max}, inclusive.
 The syntax is changed only for @var{table}, which defaults to the
 current buffer's syntax table, and not in any other syntax table.
 
-The argument @var{syntax-descriptor} is a syntax descriptor, i.e.@: a
+The argument @var{syntax-descriptor} is a syntax descriptor, i.e., a
 string whose first character is a syntax class designator and whose
 second and subsequent characters optionally specify a matching
 character and syntax flags.  @xref{Syntax Descriptors}.  An error is
@@ -478,17 +481,17 @@ it easier to see the character returned by @code{char-syntax}.)
 @end group
 
 @group
-;; Forward slash characters have punctuation syntax.  Note that this
-;; @code{char-syntax} call does not reveal that it is also part of
-;; comment-start and -end sequences.
+;; Forward slash characters have punctuation syntax.
+;; Note that this @code{char-syntax} call does not reveal
+;; that it is also part of comment-start and -end sequences.
 (string (char-syntax ?/))
      @result{} "."
 @end group
 
 @group
-;; Open parenthesis characters have open parenthesis syntax.  Note
-;; that this @code{char-syntax} call does not reveal that it has a
-;; matching character, @samp{)}.
+;; Open parenthesis characters have open parenthesis syntax.
+;; Note that this @code{char-syntax} call does not reveal that
+;; it has a matching character, @samp{)}.
 (string (char-syntax ?\())
      @result{} "("
 @end group
@@ -506,7 +509,12 @@ This function returns the current syntax table, which is the table for
 the current buffer.
 @end defun
 
-@defmac with-syntax-table @var{table} @var{body}@dots{}
+@deffn Command describe-syntax &optional buffer
+This command displays the contents of the syntax table of
+@var{buffer} (by default, the current buffer) in a help buffer.
+@end deffn
+
+@defmac with-syntax-table table body@dots{}
 This macro executes @var{body} using @var{table} as the current syntax
 table.  It returns the value of the last form in @var{body}, after
 restoring the old current syntax table.
@@ -584,6 +592,8 @@ in turn, repeatedly, until they all return @code{nil}.
 
 @node Motion and Syntax
 @section Motion and Syntax
+@cindex moving across syntax classes
+@cindex skipping characters of certain syntax
 
   This section describes functions for moving across characters that
 have certain syntax classes.
@@ -623,12 +633,14 @@ expression prefix syntax class, and characters with the @samp{p} flag.
 
 @node Parsing Expressions
 @section Parsing Expressions
+@cindex parsing expressions
+@cindex scanning expressions
 
   This section describes functions for parsing and scanning balanced
 expressions.  We will refer to such expressions as @dfn{sexps},
 following the terminology of Lisp, even though these functions can act
 on languages other than Lisp.  Basically, a sexp is either a balanced
-parenthetical grouping, a string, or a ``symbol'' (i.e.@: a sequence
+parenthetical grouping, a string, or a ``symbol'' (i.e., a sequence
 of characters whose syntax is either word constituent or symbol
 constituent).  However, characters in the expression prefix syntax
 class (@pxref{Syntax Class Table}) are treated as part of the sexp if
@@ -665,6 +677,7 @@ result, Emacs treats them as four consecutive empty string constants.
 
 @node Motion via Parsing
 @subsection Motion Commands Based on Parsing
+@cindex motion based on parsing
 
   This section describes simple point-motion functions that operate
 based on parsing expressions.
@@ -730,6 +743,7 @@ cannot exceed that many.
 
 @node Position Parse
 @subsection Finding the Parse State for a Position
+@cindex parse state for a position
 
   For syntactic analysis, such as in indentation, often the useful
 thing is to compute the syntactic state corresponding to a given buffer
@@ -911,6 +925,7 @@ nicely.
 
 @node Control Parsing
 @subsection Parameters to Control Parsing
+@cindex parsing, control parameters
 
 @defvar multibyte-syntax-as-symbol
 If this variable is non-@code{nil}, @code{scan-sexps} treats all
@@ -998,7 +1013,7 @@ corresponds to each syntax flag.
 @samp{4} @tab @code{(lsh 1 19)}
 @end multitable
 
-@defun string-to-syntax @var{desc}
+@defun string-to-syntax desc
 Given a syntax descriptor @var{desc} (a string), this function returns
 the corresponding raw syntax descriptor.
 @end defun
@@ -1052,6 +1067,7 @@ standard categories are available in all modes.
 the range @w{@samp{ }} to @samp{~}.  You specify the name of a category
 when you define it with @code{define-category}.
 
+@cindex category set
   The category table is actually a char-table (@pxref{Char-Tables}).
 The element of the category table at index @var{c} is a @dfn{category
 set}---a bool-vector---that indicates which categories character @var{c}