Mercurial > emacs
comparison lispref/syntax.texi @ 25751:467b88fab665
*** empty log message ***
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 17 Sep 1999 06:59:04 +0000 |
parents | 40089afa2b1d |
children | 6119687f6888 |
comparison
equal
deleted
inserted
replaced
25750:f1968a807f56 | 25751:467b88fab665 |
---|---|
69 | 69 |
70 A syntax table can inherit the data for some characters from the | 70 A syntax table can inherit the data for some characters from the |
71 standard syntax table, while specifying other characters itself. The | 71 standard syntax table, while specifying other characters itself. The |
72 ``inherit'' syntax class means ``inherit this character's syntax from | 72 ``inherit'' syntax class means ``inherit this character's syntax from |
73 the standard syntax table.'' Just changing the standard syntax for a | 73 the standard syntax table.'' Just changing the standard syntax for a |
74 characters affects all syntax tables which inherit from it. | 74 character affects all syntax tables that inherit from it. |
75 | 75 |
76 @defun syntax-table-p object | 76 @defun syntax-table-p object |
77 This function returns @code{t} if @var{object} is a syntax table. | 77 This function returns @code{t} if @var{object} is a syntax table. |
78 @end defun | 78 @end defun |
79 | 79 |
90 is no necessary relationship between the class of a character in one | 90 is no necessary relationship between the class of a character in one |
91 syntax table and its class in any other table. | 91 syntax table and its class in any other table. |
92 | 92 |
93 Each class is designated by a mnemonic character, which serves as the | 93 Each class is designated by a mnemonic character, which serves as the |
94 name of the class when you need to specify a class. Usually the | 94 name of the class when you need to specify a class. Usually the |
95 designator character is one that is frequently in that class; however, | 95 designator character is one that is often assigned that class; however, |
96 its meaning as a designator is unvarying and independent of what syntax | 96 its meaning as a designator is unvarying and independent of what syntax |
97 that character currently has. | 97 that character currently has. Thus, @samp{\} as a designator character |
98 always gives ``escape character'' syntax, regardless of what syntax | |
99 @samp{\} currently has. | |
98 | 100 |
99 @cindex syntax descriptor | 101 @cindex syntax descriptor |
100 A syntax descriptor is a Lisp string that specifies a syntax class, a | 102 A syntax descriptor is a Lisp string that specifies a syntax class, a |
101 matching character (used only for the parenthesis classes) and flags. | 103 matching character (used only for the parenthesis classes) and flags. |
102 The first character is the designator for a syntax class. The second | 104 The first character is the designator for a syntax class. The second |
104 Then come the characters for any desired flags. If no matching | 106 Then come the characters for any desired flags. If no matching |
105 character or flags are needed, one character is sufficient. | 107 character or flags are needed, one character is sufficient. |
106 | 108 |
107 For example, the syntax descriptor for the character @samp{*} in C | 109 For example, the syntax descriptor for the character @samp{*} in C |
108 mode is @samp{@w{. 23}} (i.e., punctuation, matching character slot | 110 mode is @samp{@w{. 23}} (i.e., punctuation, matching character slot |
109 unused, second character of a comment-starter, first character of an | 111 unused, second character of a comment-starter, first character of a |
110 comment-ender), and the entry for @samp{/} is @samp{@w{. 14}} (i.e., | 112 comment-ender), and the entry for @samp{/} is @samp{@w{. 14}} (i.e., |
111 punctuation, matching character slot unused, first character of a | 113 punctuation, matching character slot unused, first character of a |
112 comment-starter, second character of a comment-ender). | 114 comment-starter, second character of a comment-ender). |
113 | 115 |
114 @menu | 116 @menu |
540 @defun skip-syntax-forward syntaxes &optional limit | 542 @defun skip-syntax-forward syntaxes &optional limit |
541 This function moves point forward across characters having syntax classes | 543 This function moves point forward across characters having syntax classes |
542 mentioned in @var{syntaxes}. It stops when it encounters the end of | 544 mentioned in @var{syntaxes}. It stops when it encounters the end of |
543 the buffer, or position @var{limit} (if specified), or a character it is | 545 the buffer, or position @var{limit} (if specified), or a character it is |
544 not supposed to skip. | 546 not supposed to skip. |
547 | |
548 If @var{syntaxes} starts with @samp{^}, then the function skips | |
549 characters whose syntax is @emph{not} in @var{syntaxes}. | |
550 | |
545 The return value is the distance traveled, which is a nonnegative | 551 The return value is the distance traveled, which is a nonnegative |
546 integer. | 552 integer. |
547 @end defun | 553 @end defun |
548 | 554 |
549 @defun skip-syntax-backward syntaxes &optional limit | 555 @defun skip-syntax-backward syntaxes &optional limit |
550 This function moves point backward across characters whose syntax | 556 This function moves point backward across characters whose syntax |
551 classes are mentioned in @var{syntaxes}. It stops when it encounters | 557 classes are mentioned in @var{syntaxes}. It stops when it encounters |
552 the beginning of the buffer, or position @var{limit} (if specified), or a | 558 the beginning of the buffer, or position @var{limit} (if specified), or |
553 character it is not supposed to skip. | 559 a character it is not supposed to skip. |
560 | |
561 If @var{syntaxes} starts with @samp{^}, then the function skips | |
562 characters whose syntax is @emph{not} in @var{syntaxes}. | |
554 | 563 |
555 The return value indicates the distance traveled. It is an integer that | 564 The return value indicates the distance traveled. It is an integer that |
556 is zero or less. | 565 is zero or less. |
557 @end defun | 566 @end defun |
558 | 567 |
854 are defined and also which characters belong to each category. Each | 863 are defined and also which characters belong to each category. Each |
855 category table defines its own categories, but normally these are | 864 category table defines its own categories, but normally these are |
856 initialized by copying from the standard categories table, so that the | 865 initialized by copying from the standard categories table, so that the |
857 standard categories are available in all modes. | 866 standard categories are available in all modes. |
858 | 867 |
859 Each category has a name, which is an @sc{ASCII} printing character in | 868 Each category has a name, which is an @sc{ascii} printing character in |
860 the range @w{@samp{ }} to @samp{~}. You specify the name of a category | 869 the range @w{@samp{ }} to @samp{~}. You specify the name of a category |
861 when you define it with @code{define-category}. | 870 when you define it with @code{define-category}. |
862 | 871 |
863 The category table is actually a char-table (@pxref{Char-Tables}). | 872 The category table is actually a char-table (@pxref{Char-Tables}). |
864 The element of the category table at index @var{c} is a @dfn{category | 873 The element of the category table at index @var{c} is a @dfn{category |