aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Teirlinck2004-02-21 16:45:20 +0000
committerLuc Teirlinck2004-02-21 16:45:20 +0000
commit9c5609e8cccc9eec6ec9444f91e5ed2c554f6b50 (patch)
tree5135df7be44c7bfd0e3e19065266210d55256178
parentb1faee6e4f900d97631b2a80c45351474b7a5960 (diff)
downloademacs-9c5609e8cccc9eec6ec9444f91e5ed2c554f6b50.tar.gz
emacs-9c5609e8cccc9eec6ec9444f91e5ed2c554f6b50.zip
(Syntax Table Functions): Clarify and correct descriptions of
make-syntax-table and copy-syntax-table. (Motion and Syntax): Clarify SYNTAXES argument to skip-syntax-forward. (Parsing Expressions): Mention that the return value of parse-partial-sexp is currently a list of ten rather than nine elements. (Categories): Various corrections and clarifications.
-rw-r--r--lispref/ChangeLog11
-rw-r--r--lispref/syntax.texi70
2 files changed, 52 insertions, 29 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 5879c3a4596..6c97eff4551 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,14 @@
12004-02-21 Luc Teirlinck <teirllm@auburn.edu>
2
3 * syntax.texi (Syntax Table Functions): Clarify and correct
4 descriptions of make-syntax-table and copy-syntax-table.
5 (Motion and Syntax): Clarify SYNTAXES argument to
6 skip-syntax-forward.
7 (Parsing Expressions): Mention that the return value of
8 parse-partial-sexp is currently a list of ten rather than nine
9 elements.
10 (Categories): Various corrections and clarifications.
11
12004-02-17 Luc Teirlinck <teirllm@auburn.edu> 122004-02-17 Luc Teirlinck <teirllm@auburn.edu>
2 13
3 * markers.texi (Marker Insertion Types): Minor change. 14 * markers.texi (Marker Insertion Types): Minor change.
diff --git a/lispref/syntax.texi b/lispref/syntax.texi
index b2955400c8f..2628b42812e 100644
--- a/lispref/syntax.texi
+++ b/lispref/syntax.texi
@@ -397,10 +397,13 @@ prefix (@samp{'}). @xref{Motion and Syntax}.
397 In this section we describe functions for creating, accessing and 397 In this section we describe functions for creating, accessing and
398altering syntax tables. 398altering syntax tables.
399 399
400@defun make-syntax-table 400@defun make-syntax-table &optional table
401This function creates a new syntax table. It inherits the syntax for 401This function creates a new syntax table, with all values initialized
402letters and control characters from the standard syntax table. For 402to @code{nil}. If @var{table} is non-@code{nil}, it becomes the
403other characters, the syntax is copied from the standard syntax table. 403parent of the new syntax table, otherwise the standard syntax table is
404the parent. Like all char-tables, a syntax table inherits from its
405parent. Thus the original syntax of all characters in the returned
406syntax table is determined by the parent. @xref{Char-Tables}.
404 407
405Most major mode syntax tables are created in this way. 408Most major mode syntax tables are created in this way.
406@end defun 409@end defun
@@ -408,7 +411,7 @@ Most major mode syntax tables are created in this way.
408@defun copy-syntax-table &optional table 411@defun copy-syntax-table &optional table
409This function constructs a copy of @var{table} and returns it. If 412This function constructs a copy of @var{table} and returns it. If
410@var{table} is not supplied (or is @code{nil}), it returns a copy of the 413@var{table} is not supplied (or is @code{nil}), it returns a copy of the
411current syntax table. Otherwise, an error is signaled if @var{table} is 414standard syntax table. Otherwise, an error is signaled if @var{table} is
412not a syntax table. 415not a syntax table.
413@end defun 416@end defun
414 417
@@ -425,7 +428,7 @@ This function always returns @code{nil}. The old syntax information in
425the table for this character is discarded. 428the table for this character is discarded.
426 429
427An error is signaled if the first character of the syntax descriptor is not 430An error is signaled if the first character of the syntax descriptor is not
428one of the twelve syntax class designator characters. An error is also 431one of the seventeen syntax class designator characters. An error is also
429signaled if @var{char} is not a character. 432signaled if @var{char} is not a character.
430 433
431@example 434@example
@@ -559,10 +562,11 @@ table.
559have certain syntax classes. 562have certain syntax classes.
560 563
561@defun skip-syntax-forward syntaxes &optional limit 564@defun skip-syntax-forward syntaxes &optional limit
562This function moves point forward across characters having syntax classes 565This function moves point forward across characters having syntax
563mentioned in @var{syntaxes}. It stops when it encounters the end of 566classes mentioned in @var{syntaxes} (a string of syntax code
564the buffer, or position @var{limit} (if specified), or a character it is 567characters). It stops when it encounters the end of the buffer, or
565not supposed to skip. 568position @var{limit} (if specified), or a character it is not supposed
569to skip.
566 570
567If @var{syntaxes} starts with @samp{^}, then the function skips 571If @var{syntaxes} starts with @samp{^}, then the function skips
568characters whose syntax is @emph{not} in @var{syntaxes}. 572characters whose syntax is @emph{not} in @var{syntaxes}.
@@ -697,9 +701,10 @@ that can be nested.
697The minimum parenthesis depth encountered during this scan. 701The minimum parenthesis depth encountered during this scan.
698 702
699@item 703@item
700What kind of comment is active: @code{nil} for a comment of style ``a'', 704What kind of comment is active: @code{nil} for a comment of style
701@code{t} for a comment of style ``b'', and @code{syntax-table} for 705``a'' or when not inside a comment, @code{t} for a comment of style
702a comment that should be ended by a generic comment delimiter character. 706``b'', and @code{syntax-table} for a comment that should be ended by a
707generic comment delimiter character.
703 708
704@item 709@item
705The string or comment start position. While inside a comment, this is 710The string or comment start position. While inside a comment, this is
@@ -710,6 +715,12 @@ this element is @code{nil}.
710 715
711Elements 0, 3, 4, 5 and 7 are significant in the argument @var{state}. 716Elements 0, 3, 4, 5 and 7 are significant in the argument @var{state}.
712 717
718Actually, the return value is currently a list of ten, rather than
719nine, elements and @var{state} is allowed to be a list of ten elements
720as well. However, the meaning of the tenth element is subject to
721change and only the first eight elements of @var{state} need to be
722specified.
723
713@cindex indenting with parentheses 724@cindex indenting with parentheses
714This function is most often used to compute indentation for languages 725This function is most often used to compute indentation for languages
715that have nested parentheses. 726that have nested parentheses.
@@ -757,11 +768,11 @@ of what the syntax table says about them. (However, text properties
757can still override the syntax.) 768can still override the syntax.)
758@end defvar 769@end defvar
759 770
760@defvar parse-sexp-ignore-comments 771@defopt parse-sexp-ignore-comments
761@cindex skipping comments 772@cindex skipping comments
762If the value is non-@code{nil}, then comments are treated as 773If the value is non-@code{nil}, then comments are treated as
763whitespace by the functions in this section and by @code{forward-sexp}. 774whitespace by the functions in this section and by @code{forward-sexp}.
764@end defvar 775@end defopt
765 776
766@vindex parse-sexp-lookup-properties 777@vindex parse-sexp-lookup-properties
767The behaviour of @code{parse-partial-sexp} is also affected by 778The behaviour of @code{parse-partial-sexp} is also affected by
@@ -951,12 +962,12 @@ belongs to. In this category set, if the element at index @var{cat} is
951@code{t}, that means category @var{cat} is a member of the set, and that 962@code{t}, that means category @var{cat} is a member of the set, and that
952character @var{c} belongs to category @var{cat}. 963character @var{c} belongs to category @var{cat}.
953 964
965For the next three functions, the optional argument @var{table}
966defaults to the current buffer's category table.
967
954@defun define-category char docstring &optional table 968@defun define-category char docstring &optional table
955This function defines a new category, with name @var{char} and 969This function defines a new category, with name @var{char} and
956documentation @var{docstring}. 970documentation @var{docstring}, for the category table @var{table},
957
958The new category is defined for category table @var{table}, which
959defaults to the current buffer's category table.
960@end defun 971@end defun
961 972
962@defun category-docstring category &optional table 973@defun category-docstring category &optional table
@@ -971,7 +982,7 @@ in category table @var{table}.
971@end example 982@end example
972@end defun 983@end defun
973 984
974@defun get-unused-category table 985@defun get-unused-category &optional table
975This function returns a category name (a character) which is not 986This function returns a category name (a character) which is not
976currently defined in @var{table}. If all possible categories are in use 987currently defined in @var{table}. If all possible categories are in use
977in @var{table}, it returns @code{nil}. 988in @var{table}, it returns @code{nil}.
@@ -993,7 +1004,7 @@ This function returns the standard category table.
993@defun copy-category-table &optional table 1004@defun copy-category-table &optional table
994This function constructs a copy of @var{table} and returns it. If 1005This function constructs a copy of @var{table} and returns it. If
995@var{table} is not supplied (or is @code{nil}), it returns a copy of the 1006@var{table} is not supplied (or is @code{nil}), it returns a copy of the
996current category table. Otherwise, an error is signaled if @var{table} 1007standard category table. Otherwise, an error is signaled if @var{table}
997is not a category table. 1008is not a category table.
998@end defun 1009@end defun
999 1010
@@ -1023,11 +1034,11 @@ other categories.
1023@end defun 1034@end defun
1024 1035
1025@defun char-category-set char 1036@defun char-category-set char
1026This function returns the category set for character @var{char}. This 1037This function returns the category set for character @var{char} in the
1027is the bool-vector which records which categories the character 1038current buffer's category table. This is the bool-vector which
1028@var{char} belongs to. The function @code{char-category-set} does not 1039records which categories the character @var{char} belongs to. The
1029allocate storage, because it returns the same bool-vector that exists in 1040function @code{char-category-set} does not allocate storage, because
1030the category table. 1041it returns the same bool-vector that exists in the category table.
1031 1042
1032@example 1043@example
1033(char-category-set ?a) 1044(char-category-set ?a)
@@ -1056,10 +1067,11 @@ But if @var{reset} is non-@code{nil}, then it deletes @var{category}
1056instead. 1067instead.
1057@end defun 1068@end defun
1058 1069
1059@deffn Command describe-categories 1070@deffn Command describe-categories &optional buffer-or-name
1060This function describes the category specifications in the current 1071This function describes the category specifications in the current
1061category table. The descriptions are inserted in a buffer, which is 1072category table. It inserts the descriptions in a buffer, and then
1062then displayed. 1073displays that buffer. If @var{buffer-or-name} is non-@code{nil}, it
1074describes the category table of that buffer instead.
1063@end deffn 1075@end deffn
1064 1076
1065@ignore 1077@ignore