diff options
| author | Luc Teirlinck | 2004-02-21 16:45:20 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2004-02-21 16:45:20 +0000 |
| commit | 9c5609e8cccc9eec6ec9444f91e5ed2c554f6b50 (patch) | |
| tree | 5135df7be44c7bfd0e3e19065266210d55256178 | |
| parent | b1faee6e4f900d97631b2a80c45351474b7a5960 (diff) | |
| download | emacs-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/ChangeLog | 11 | ||||
| -rw-r--r-- | lispref/syntax.texi | 70 |
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 @@ | |||
| 1 | 2004-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 | |||
| 1 | 2004-02-17 Luc Teirlinck <teirllm@auburn.edu> | 12 | 2004-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 |
| 398 | altering syntax tables. | 398 | altering syntax tables. |
| 399 | 399 | ||
| 400 | @defun make-syntax-table | 400 | @defun make-syntax-table &optional table |
| 401 | This function creates a new syntax table. It inherits the syntax for | 401 | This function creates a new syntax table, with all values initialized |
| 402 | letters and control characters from the standard syntax table. For | 402 | to @code{nil}. If @var{table} is non-@code{nil}, it becomes the |
| 403 | other characters, the syntax is copied from the standard syntax table. | 403 | parent of the new syntax table, otherwise the standard syntax table is |
| 404 | the parent. Like all char-tables, a syntax table inherits from its | ||
| 405 | parent. Thus the original syntax of all characters in the returned | ||
| 406 | syntax table is determined by the parent. @xref{Char-Tables}. | ||
| 404 | 407 | ||
| 405 | Most major mode syntax tables are created in this way. | 408 | Most 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 |
| 409 | This function constructs a copy of @var{table} and returns it. If | 412 | This 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 |
| 411 | current syntax table. Otherwise, an error is signaled if @var{table} is | 414 | standard syntax table. Otherwise, an error is signaled if @var{table} is |
| 412 | not a syntax table. | 415 | not 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 | |||
| 425 | the table for this character is discarded. | 428 | the table for this character is discarded. |
| 426 | 429 | ||
| 427 | An error is signaled if the first character of the syntax descriptor is not | 430 | An error is signaled if the first character of the syntax descriptor is not |
| 428 | one of the twelve syntax class designator characters. An error is also | 431 | one of the seventeen syntax class designator characters. An error is also |
| 429 | signaled if @var{char} is not a character. | 432 | signaled if @var{char} is not a character. |
| 430 | 433 | ||
| 431 | @example | 434 | @example |
| @@ -559,10 +562,11 @@ table. | |||
| 559 | have certain syntax classes. | 562 | have certain syntax classes. |
| 560 | 563 | ||
| 561 | @defun skip-syntax-forward syntaxes &optional limit | 564 | @defun skip-syntax-forward syntaxes &optional limit |
| 562 | This function moves point forward across characters having syntax classes | 565 | This function moves point forward across characters having syntax |
| 563 | mentioned in @var{syntaxes}. It stops when it encounters the end of | 566 | classes mentioned in @var{syntaxes} (a string of syntax code |
| 564 | the buffer, or position @var{limit} (if specified), or a character it is | 567 | characters). It stops when it encounters the end of the buffer, or |
| 565 | not supposed to skip. | 568 | position @var{limit} (if specified), or a character it is not supposed |
| 569 | to skip. | ||
| 566 | 570 | ||
| 567 | If @var{syntaxes} starts with @samp{^}, then the function skips | 571 | If @var{syntaxes} starts with @samp{^}, then the function skips |
| 568 | characters whose syntax is @emph{not} in @var{syntaxes}. | 572 | characters whose syntax is @emph{not} in @var{syntaxes}. |
| @@ -697,9 +701,10 @@ that can be nested. | |||
| 697 | The minimum parenthesis depth encountered during this scan. | 701 | The minimum parenthesis depth encountered during this scan. |
| 698 | 702 | ||
| 699 | @item | 703 | @item |
| 700 | What kind of comment is active: @code{nil} for a comment of style ``a'', | 704 | What 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 |
| 702 | a 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 |
| 707 | generic comment delimiter character. | ||
| 703 | 708 | ||
| 704 | @item | 709 | @item |
| 705 | The string or comment start position. While inside a comment, this is | 710 | The string or comment start position. While inside a comment, this is |
| @@ -710,6 +715,12 @@ this element is @code{nil}. | |||
| 710 | 715 | ||
| 711 | Elements 0, 3, 4, 5 and 7 are significant in the argument @var{state}. | 716 | Elements 0, 3, 4, 5 and 7 are significant in the argument @var{state}. |
| 712 | 717 | ||
| 718 | Actually, the return value is currently a list of ten, rather than | ||
| 719 | nine, elements and @var{state} is allowed to be a list of ten elements | ||
| 720 | as well. However, the meaning of the tenth element is subject to | ||
| 721 | change and only the first eight elements of @var{state} need to be | ||
| 722 | specified. | ||
| 723 | |||
| 713 | @cindex indenting with parentheses | 724 | @cindex indenting with parentheses |
| 714 | This function is most often used to compute indentation for languages | 725 | This function is most often used to compute indentation for languages |
| 715 | that have nested parentheses. | 726 | that have nested parentheses. |
| @@ -757,11 +768,11 @@ of what the syntax table says about them. (However, text properties | |||
| 757 | can still override the syntax.) | 768 | can 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 |
| 762 | If the value is non-@code{nil}, then comments are treated as | 773 | If the value is non-@code{nil}, then comments are treated as |
| 763 | whitespace by the functions in this section and by @code{forward-sexp}. | 774 | whitespace 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 |
| 767 | The behaviour of @code{parse-partial-sexp} is also affected by | 778 | The 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 |
| 952 | character @var{c} belongs to category @var{cat}. | 963 | character @var{c} belongs to category @var{cat}. |
| 953 | 964 | ||
| 965 | For the next three functions, the optional argument @var{table} | ||
| 966 | defaults to the current buffer's category table. | ||
| 967 | |||
| 954 | @defun define-category char docstring &optional table | 968 | @defun define-category char docstring &optional table |
| 955 | This function defines a new category, with name @var{char} and | 969 | This function defines a new category, with name @var{char} and |
| 956 | documentation @var{docstring}. | 970 | documentation @var{docstring}, for the category table @var{table}, |
| 957 | |||
| 958 | The new category is defined for category table @var{table}, which | ||
| 959 | defaults 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 |
| 975 | This function returns a category name (a character) which is not | 986 | This function returns a category name (a character) which is not |
| 976 | currently defined in @var{table}. If all possible categories are in use | 987 | currently defined in @var{table}. If all possible categories are in use |
| 977 | in @var{table}, it returns @code{nil}. | 988 | in @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 |
| 994 | This function constructs a copy of @var{table} and returns it. If | 1005 | This 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 |
| 996 | current category table. Otherwise, an error is signaled if @var{table} | 1007 | standard category table. Otherwise, an error is signaled if @var{table} |
| 997 | is not a category table. | 1008 | is 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 |
| 1026 | This function returns the category set for character @var{char}. This | 1037 | This function returns the category set for character @var{char} in the |
| 1027 | is the bool-vector which records which categories the character | 1038 | current buffer's category table. This is the bool-vector which |
| 1028 | @var{char} belongs to. The function @code{char-category-set} does not | 1039 | records which categories the character @var{char} belongs to. The |
| 1029 | allocate storage, because it returns the same bool-vector that exists in | 1040 | function @code{char-category-set} does not allocate storage, because |
| 1030 | the category table. | 1041 | it 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} | |||
| 1056 | instead. | 1067 | instead. |
| 1057 | @end defun | 1068 | @end defun |
| 1058 | 1069 | ||
| 1059 | @deffn Command describe-categories | 1070 | @deffn Command describe-categories &optional buffer-or-name |
| 1060 | This function describes the category specifications in the current | 1071 | This function describes the category specifications in the current |
| 1061 | category table. The descriptions are inserted in a buffer, which is | 1072 | category table. It inserts the descriptions in a buffer, and then |
| 1062 | then displayed. | 1073 | displays that buffer. If @var{buffer-or-name} is non-@code{nil}, it |
| 1074 | describes the category table of that buffer instead. | ||
| 1063 | @end deffn | 1075 | @end deffn |
| 1064 | 1076 | ||
| 1065 | @ignore | 1077 | @ignore |