aboutsummaryrefslogtreecommitdiffstats
path: root/lispref/syntax.texi
diff options
context:
space:
mode:
authorRichard M. Stallman2005-02-27 00:12:33 +0000
committerRichard M. Stallman2005-02-27 00:12:33 +0000
commit8a2f014e40fa63d17cf48e3d56faa01c14f7df0a (patch)
treef0721254e2aa2f9ff2d6011ae0e526fcc87a6192 /lispref/syntax.texi
parenta87ffdbca993ceed4f5355103b2536c2e50042ee (diff)
downloademacs-8a2f014e40fa63d17cf48e3d56faa01c14f7df0a.tar.gz
emacs-8a2f014e40fa63d17cf48e3d56faa01c14f7df0a.zip
(Syntax Class Table): Clarify.
(Syntax Table Functions): syntax-after moved from here. (Syntax Table Internals): syntax-after moved to here. (Parsing Expressions): Update info on number of values and what's meaningful in the STATE argument. (Categories): Fix typo.
Diffstat (limited to 'lispref/syntax.texi')
-rw-r--r--lispref/syntax.texi42
1 files changed, 22 insertions, 20 deletions
diff --git a/lispref/syntax.texi b/lispref/syntax.texi
index 1dc1a2587e5..438c1815fe4 100644
--- a/lispref/syntax.texi
+++ b/lispref/syntax.texi
@@ -155,9 +155,10 @@ character that is valid in symbols is underscore (@samp{_}).
155@dfn{Punctuation characters} (designated by @samp{.}) are those 155@dfn{Punctuation characters} (designated by @samp{.}) are those
156characters that are used as punctuation in English, or are used in some 156characters that are used as punctuation in English, or are used in some
157way in a programming language to separate symbols from one another. 157way in a programming language to separate symbols from one another.
158Most programming language modes, including Emacs Lisp mode, have no 158Some programming language modes, such as Emacs Lisp mode, have no
159characters in this class since the few characters that are not symbol or 159characters in this class since the few characters that are not symbol or
160word constituents all have other uses. 160word constituents all have other uses. Other programming language modes,
161such as C mode, use punctuation syntax for operators.
161@end deffn 162@end deffn
162 163
163@deffn {Syntax class} @w{open parenthesis character} 164@deffn {Syntax class} @w{open parenthesis character}
@@ -501,12 +502,6 @@ We use @code{string} to make it easier to see the character returned by
501@code{char-syntax}. 502@code{char-syntax}.
502@end defun 503@end defun
503 504
504@defun syntax-after pos
505This function returns a description of the syntax of the character in
506the buffer after position @var{pos}, taking account of syntax
507properties as well as the syntax table.
508@end defun
509
510@defun set-syntax-table table 505@defun set-syntax-table table
511This function makes @var{table} the syntax table for the current buffer. 506This function makes @var{table} the syntax table for the current buffer.
512It returns @var{table}. 507It returns @var{table}.
@@ -664,13 +659,13 @@ start of a comment. If @var{stop-comment} is the symbol
664string, or the end of a comment or a string, whichever comes first. 659string, or the end of a comment or a string, whichever comes first.
665 660
666@cindex parse state 661@cindex parse state
667The fifth argument @var{state} is a nine-element list of the same form 662The fifth argument @var{state} is a ten-element list of the same form
668as the value of this function, described below. (It is OK to omit the 663as the value of this function, described below. (It is OK to omit the
669last element of the nine.) The return value of one call may be used to 664last two elements of this list.) The return value of one call may be
670initialize the state of the parse on another call to 665used to initialize the state of the parse on another call to
671@code{parse-partial-sexp}. 666@code{parse-partial-sexp}.
672 667
673The result is a list of nine elements describing the final state of 668The result is a list of ten elements describing the final state of
674the parse: 669the parse:
675 670
676@enumerate 0 671@enumerate 0
@@ -717,15 +712,16 @@ The string or comment start position. While inside a comment, this is
717the position where the comment began; while inside a string, this is the 712the position where the comment began; while inside a string, this is the
718position where the string began. When outside of strings and comments, 713position where the string began. When outside of strings and comments,
719this element is @code{nil}. 714this element is @code{nil}.
720@end enumerate
721 715
722Elements 0, 3, 4, 5 and 7 are significant in the argument @var{state}. 716@item
717Internal data for continuing the parsing. The meaning of this
718data is subject to change; it is used if you pass this list
719as the @var{state} argument to another call.
720
721@end enumerate
723 722
724Actually, the return value is currently a list of ten, rather than 723Elements 0, 3, 4, 5, 7 and 9 are significant in the argument
725nine, elements and @var{state} is allowed to be a list of ten elements 724@var{state}.
726as well. However, the meaning of the tenth element is subject to
727change and only the first eight elements of @var{state} need to be
728specified.
729 725
730@cindex indenting with parentheses 726@cindex indenting with parentheses
731This function is most often used to compute indentation for languages 727This function is most often used to compute indentation for languages
@@ -941,6 +937,12 @@ This function returns the internal form @code{(@var{syntax-code} .
941@var{matching-char})} corresponding to the syntax descriptor @var{desc}. 937@var{matching-char})} corresponding to the syntax descriptor @var{desc}.
942@end defun 938@end defun
943 939
940@defun syntax-after pos
941This function returns the syntax code of the character in the buffer
942after position @var{pos}, taking account of syntax properties as well
943as the syntax table.
944@end defun
945
944@node Categories 946@node Categories
945@section Categories 947@section Categories
946@cindex categories of characters 948@cindex categories of characters
@@ -973,7 +975,7 @@ defaults to the current buffer's category table.
973 975
974@defun define-category char docstring &optional table 976@defun define-category char docstring &optional table
975This function defines a new category, with name @var{char} and 977This function defines a new category, with name @var{char} and
976documentation @var{docstring}, for the category table @var{table}, 978documentation @var{docstring}, for the category table @var{table}.
977@end defun 979@end defun
978 980
979@defun category-docstring category &optional table 981@defun category-docstring category &optional table