diff options
| author | Richard M. Stallman | 1994-08-07 00:25:52 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-08-07 00:25:52 +0000 |
| commit | 7fd1911a25beb04d512aa77e9b335e817fbb9bf2 (patch) | |
| tree | 8f40ecd2714b170ccd3a4df3da04a8fdc62badcb | |
| parent | ab63960fcfadeca67b2777e66cfaea04ee459b69 (diff) | |
| download | emacs-7fd1911a25beb04d512aa77e9b335e817fbb9bf2.tar.gz emacs-7fd1911a25beb04d512aa77e9b335e817fbb9bf2.zip | |
entered into RCS
| -rw-r--r-- | lispref/searching.texi | 90 | ||||
| -rw-r--r-- | lispref/syntax.texi | 88 |
2 files changed, 102 insertions, 76 deletions
diff --git a/lispref/searching.texi b/lispref/searching.texi index 98ce0f7c9e7..c6dfc72321f 100644 --- a/lispref/searching.texi +++ b/lispref/searching.texi | |||
| @@ -533,8 +533,8 @@ deciphered as follows: | |||
| 533 | 533 | ||
| 534 | @table @code | 534 | @table @code |
| 535 | @item [.?!] | 535 | @item [.?!] |
| 536 | The first part of the pattern consists of three characters, a period, a | 536 | The first part of the pattern is a character set that matches any one of |
| 537 | question mark and an exclamation mark, within square brackets. The | 537 | three characters: period, question mark, and exclamation mark. The |
| 538 | match must begin with one of these three characters. | 538 | match must begin with one of these three characters. |
| 539 | 539 | ||
| 540 | @item []\"')@}]* | 540 | @item []\"')@}]* |
| @@ -545,11 +545,11 @@ a string. The @samp{*} at the end indicates that the immediately | |||
| 545 | preceding regular expression (a character set, in this case) may be | 545 | preceding regular expression (a character set, in this case) may be |
| 546 | repeated zero or more times. | 546 | repeated zero or more times. |
| 547 | 547 | ||
| 548 | @item \\($\\|@ \\|\t\\|@ @ \\) | 548 | @item \\($\\|@ $\\|\t\\|@ @ \\) |
| 549 | The third part of the pattern matches the whitespace that follows the | 549 | The third part of the pattern matches the whitespace that follows the |
| 550 | end of a sentence: the end of a line, or a tab, or two spaces. The | 550 | end of a sentence: the end of a line, or a tab, or two spaces. The |
| 551 | double backslashes mark the parentheses and vertical bars as regular | 551 | double backslashes mark the parentheses and vertical bars as regular |
| 552 | expression syntax; the parentheses mark the group and the vertical bars | 552 | expression syntax; the parentheses delimit a group and the vertical bars |
| 553 | separate alternatives. The dollar sign is used to match the end of a | 553 | separate alternatives. The dollar sign is used to match the end of a |
| 554 | line. | 554 | line. |
| 555 | 555 | ||
| @@ -624,14 +624,14 @@ This function searches backward in the current buffer for a string of | |||
| 624 | text that is matched by the regular expression @var{regexp}, leaving | 624 | text that is matched by the regular expression @var{regexp}, leaving |
| 625 | point at the beginning of the first text found. | 625 | point at the beginning of the first text found. |
| 626 | 626 | ||
| 627 | This function is analogous to @code{re-search-forward}, but they are | 627 | This function is analogous to @code{re-search-forward}, but they are not |
| 628 | not simple mirror images. @code{re-search-forward} finds the match | 628 | simple mirror images. @code{re-search-forward} finds the match whose |
| 629 | whose beginning is as close as possible. If @code{re-search-backward} | 629 | beginning is as close as possible to the starting point. If |
| 630 | were a perfect mirror image, it would find the match whose end is as | 630 | @code{re-search-backward} were a perfect mirror image, it would find the |
| 631 | close as possible. However, in fact it finds the match whose beginning | 631 | match whose end is as close as possible. However, in fact it finds the |
| 632 | is as close as possible. The reason is that matching a regular | 632 | match whose beginning is as close as possible. The reason is that |
| 633 | expression at a given spot always works from beginning to end, and is | 633 | matching a regular expression at a given spot always works from |
| 634 | done at a specified beginning position. | 634 | beginning to end, and starts at a specified beginning position. |
| 635 | 635 | ||
| 636 | A true mirror-image of @code{re-search-forward} would require a special | 636 | A true mirror-image of @code{re-search-forward} would require a special |
| 637 | feature for matching regexps from end to beginning. It's not worth the | 637 | feature for matching regexps from end to beginning. It's not worth the |
| @@ -804,8 +804,8 @@ number of occurrences to consider. In this case, @code{perform-replace} | |||
| 804 | returns after considering that many occurrences. | 804 | returns after considering that many occurrences. |
| 805 | 805 | ||
| 806 | Normally, the keymap @code{query-replace-map} defines the possible user | 806 | Normally, the keymap @code{query-replace-map} defines the possible user |
| 807 | responses. The argument @var{map}, if non-@code{nil}, is a keymap to | 807 | responses for queries. The argument @var{map}, if non-@code{nil}, is a |
| 808 | use instead of @code{query-replace-map}. | 808 | keymap to use instead of @code{query-replace-map}. |
| 809 | @end defun | 809 | @end defun |
| 810 | 810 | ||
| 811 | @defvar query-replace-map | 811 | @defvar query-replace-map |
| @@ -837,10 +837,12 @@ Do take the action being considered---in other words, ``yes.'' | |||
| 837 | Do not take action for this question---in other words, ``no.'' | 837 | Do not take action for this question---in other words, ``no.'' |
| 838 | 838 | ||
| 839 | @item exit | 839 | @item exit |
| 840 | Answer this question ``no,'' and don't ask any more. | 840 | Answer this question ``no,'' and give up on the entire series of |
| 841 | questions, assuming that the answers will be ``no.'' | ||
| 841 | 842 | ||
| 842 | @item act-and-exit | 843 | @item act-and-exit |
| 843 | Answer this question ``yes,'' and don't ask any more. | 844 | Answer this question ``yes,'' and give up on the entire series of |
| 845 | questions, assuming that subsequent answers will be ``no.'' | ||
| 844 | 846 | ||
| 845 | @item act-and-show | 847 | @item act-and-show |
| 846 | Answer this question ``yes,'' but show the results---don't advance yet | 848 | Answer this question ``yes,'' but show the results---don't advance yet |
| @@ -908,19 +910,18 @@ expression. | |||
| 908 | This function returns the position of the start of text matched by the | 910 | This function returns the position of the start of text matched by the |
| 909 | last regular expression searched for, or a subexpression of it. | 911 | last regular expression searched for, or a subexpression of it. |
| 910 | 912 | ||
| 911 | The argument @var{count}, a number, specifies a subexpression whose | 913 | If @var{count} is zero, then the value is the position of the start of |
| 912 | start position is the value. If @var{count} is zero, then the value is | 914 | the text matched by the whole regexp. Otherwise, @var{count}, specifies |
| 913 | the position of the text matched by the whole regexp. If @var{count} is | 915 | a subexpression in the regular expresion. The value of the function is |
| 914 | greater than zero, then the value is the position of the beginning of | 916 | the starting position of the match for that subexpression. |
| 915 | the text matched by the @var{count}th subexpression. | ||
| 916 | 917 | ||
| 917 | Subexpressions of a regular expression are those expressions grouped | 918 | Subexpressions of a regular expression are those expressions grouped |
| 918 | inside of parentheses, @samp{\(@dots{}\)}. The @var{count}th | 919 | with escaped parentheses, @samp{\(@dots{}\)}. The @var{count}th |
| 919 | subexpression is found by counting occurrences of @samp{\(} from the | 920 | subexpression is found by counting occurrences of @samp{\(} from the |
| 920 | beginning of the whole regular expression. The first subexpression is | 921 | beginning of the whole regular expression. The first subexpression is |
| 921 | numbered 1, the second 2, and so on. | 922 | numbered 1, the second 2, and so on. |
| 922 | 923 | ||
| 923 | The value is @code{nil} for a parenthetical grouping inside of a | 924 | The value is @code{nil} for a subexpression inside a |
| 924 | @samp{\|} alternative that wasn't used in the match. | 925 | @samp{\|} alternative that wasn't used in the match. |
| 925 | @end defun | 926 | @end defun |
| 926 | 927 | ||
| @@ -972,7 +973,7 @@ subexpression is at the 13th character (@samp{c}). | |||
| 972 | (re-search-forward "The \\(cat \\)") | 973 | (re-search-forward "The \\(cat \\)") |
| 973 | (match-beginning 0) | 974 | (match-beginning 0) |
| 974 | (match-beginning 1)) | 975 | (match-beginning 1)) |
| 975 | @result{} (t 9 13) | 976 | @result{} (9 9 13) |
| 976 | @end group | 977 | @end group |
| 977 | 978 | ||
| 978 | @group | 979 | @group |
| @@ -1011,6 +1012,9 @@ If the original text contains just one word, and that word is a capital | |||
| 1011 | letter, @code{replace-match} considers this a capitalized first word | 1012 | letter, @code{replace-match} considers this a capitalized first word |
| 1012 | rather than all upper case. | 1013 | rather than all upper case. |
| 1013 | 1014 | ||
| 1015 | If @code{case-replace} is @code{nil}, then case conversion is not done, | ||
| 1016 | regardless of the value of @var{fixed-case}. @xref{Searching and Case}. | ||
| 1017 | |||
| 1014 | If @var{literal} is non-@code{nil}, then @var{replacement} is inserted | 1018 | If @var{literal} is non-@code{nil}, then @var{replacement} is inserted |
| 1015 | exactly as it is, the only alterations being case changes as needed. | 1019 | exactly as it is, the only alterations being case changes as needed. |
| 1016 | If it is @code{nil} (the default), then the character @samp{\} is treated | 1020 | If it is @code{nil} (the default), then the character @samp{\} is treated |
| @@ -1024,9 +1028,9 @@ part of one of the following sequences: | |||
| 1024 | 1028 | ||
| 1025 | @item @samp{\@var{n}} | 1029 | @item @samp{\@var{n}} |
| 1026 | @cindex @samp{\@var{n}} in replacement | 1030 | @cindex @samp{\@var{n}} in replacement |
| 1027 | @samp{\@var{n}} stands for the text that matched the @var{n}th | 1031 | @samp{\@var{n}}, where @var{n} is a digit, stands for the text that |
| 1028 | subexpression in the original regexp. Subexpressions are those | 1032 | matched the @var{n}th subexpression in the original regexp. |
| 1029 | expressions grouped inside of @samp{\(@dots{}\)}. @var{n} is a digit. | 1033 | Subexpressions are those expressions grouped inside @samp{\(@dots{}\)}. |
| 1030 | 1034 | ||
| 1031 | @item @samp{\\} | 1035 | @item @samp{\\} |
| 1032 | @cindex @samp{\} in replacement | 1036 | @cindex @samp{\} in replacement |
| @@ -1182,8 +1186,8 @@ particular character sets, are included: thus, @samp{[aB]} would match | |||
| 1182 | 1186 | ||
| 1183 | If you do not want this feature, set the variable | 1187 | If you do not want this feature, set the variable |
| 1184 | @code{case-fold-search} to @code{nil}. Then all letters must match | 1188 | @code{case-fold-search} to @code{nil}. Then all letters must match |
| 1185 | exactly, including case. This is a per-buffer-local variable; altering | 1189 | exactly, including case. This is a buffer-local variable; altering the |
| 1186 | the variable affects only the current buffer. (@xref{Intro to | 1190 | variable affects only the current buffer. (@xref{Intro to |
| 1187 | Buffer-Local}.) Alternatively, you may change the value of | 1191 | Buffer-Local}.) Alternatively, you may change the value of |
| 1188 | @code{default-case-fold-search}, which is the default value of | 1192 | @code{default-case-fold-search}, which is the default value of |
| 1189 | @code{case-fold-search} for buffers that do not override it. | 1193 | @code{case-fold-search} for buffers that do not override it. |
| @@ -1195,9 +1199,13 @@ for an upper case letter only. But this has nothing to do with the | |||
| 1195 | searching functions Lisp functions use. | 1199 | searching functions Lisp functions use. |
| 1196 | 1200 | ||
| 1197 | @defopt case-replace | 1201 | @defopt case-replace |
| 1198 | This variable determines whether @code{query-replace} should preserve | 1202 | This variable determines whether the replacement functions should |
| 1199 | case in replacements. If the variable is @code{nil}, then | 1203 | preserve case. If the variable is @code{nil}, that means to use the |
| 1200 | @code{replace-match} should not try to convert case. | 1204 | replacement text verbatim. A non-@code{nil} value means to convert the |
| 1205 | case of the replacement text according to the text being replaced. | ||
| 1206 | |||
| 1207 | The function @code{replace-match} is where this variable actually has | ||
| 1208 | its effect. @xref{Replacing Match}. | ||
| 1201 | @end defopt | 1209 | @end defopt |
| 1202 | 1210 | ||
| 1203 | @defopt case-fold-search | 1211 | @defopt case-fold-search |
| @@ -1222,21 +1230,22 @@ used for certain purposes in editing: | |||
| 1222 | 1230 | ||
| 1223 | @defvar page-delimiter | 1231 | @defvar page-delimiter |
| 1224 | This is the regexp describing line-beginnings that separate pages. The | 1232 | This is the regexp describing line-beginnings that separate pages. The |
| 1225 | default value is @code{"^\014"} (i.e., @code{"^^L"} or @code{"^\C-l"}). | 1233 | default value is @code{"^\014"} (i.e., @code{"^^L"} or @code{"^\C-l"}); |
| 1234 | this matches a line that starts with a formfeed character. | ||
| 1226 | @end defvar | 1235 | @end defvar |
| 1227 | 1236 | ||
| 1228 | @defvar paragraph-separate | 1237 | @defvar paragraph-separate |
| 1229 | This is the regular expression for recognizing the beginning of a line | 1238 | This is the regular expression for recognizing the beginning of a line |
| 1230 | that separates paragraphs. (If you change this, you may have to | 1239 | that separates paragraphs. (If you change this, you may have to |
| 1231 | change @code{paragraph-start} also.) The default value is @code{"^[ | 1240 | change @code{paragraph-start} also.) The default value is |
| 1232 | \t\f]*$"}, which is a line that consists entirely of spaces, tabs, and | 1241 | @w{@code{"^[@ \t\f]*$"}}, which matches a line that consists entirely of |
| 1233 | form feeds. | 1242 | spaces, tabs, and form feeds. |
| 1234 | @end defvar | 1243 | @end defvar |
| 1235 | 1244 | ||
| 1236 | @defvar paragraph-start | 1245 | @defvar paragraph-start |
| 1237 | This is the regular expression for recognizing the beginning of a line | 1246 | This is the regular expression for recognizing the beginning of a line |
| 1238 | that starts @emph{or} separates paragraphs. The default value is | 1247 | that starts @emph{or} separates paragraphs. The default value is |
| 1239 | @code{"^[ \t\n\f]"}, which matches a line starting with a space, tab, | 1248 | @w{@code{"^[@ \t\n\f]"}}, which matches a line starting with a space, tab, |
| 1240 | newline, or form feed. | 1249 | newline, or form feed. |
| 1241 | @end defvar | 1250 | @end defvar |
| 1242 | 1251 | ||
| @@ -1246,11 +1255,12 @@ paragraph boundaries also end sentences, regardless.) The default value | |||
| 1246 | is: | 1255 | is: |
| 1247 | 1256 | ||
| 1248 | @example | 1257 | @example |
| 1249 | "[.?!][]\"')@}]*\\($\\|\t\\| \\)[ \t\n]*" | 1258 | "[.?!][]\"')@}]*\\($\\| $\\|\t\\| \\)[ \t\n]*" |
| 1250 | @end example | 1259 | @end example |
| 1251 | 1260 | ||
| 1252 | This means a period, question mark or exclamation mark, followed by a | 1261 | This means a period, question mark or exclamation mark, followed |
| 1253 | closing brace, followed by tabs, spaces or new lines. | 1262 | optionally by a closing parenthetical character, followed by tabs, |
| 1263 | spaces or new lines. | ||
| 1254 | 1264 | ||
| 1255 | For a detailed explanation of this regular expression, see @ref{Regexp | 1265 | For a detailed explanation of this regular expression, see @ref{Regexp |
| 1256 | Example}. | 1266 | Example}. |
diff --git a/lispref/syntax.texi b/lispref/syntax.texi index 9766df698f2..1e0e314debc 100644 --- a/lispref/syntax.texi +++ b/lispref/syntax.texi | |||
| @@ -56,7 +56,7 @@ mode, the character @samp{;} begins a comment, but in C mode, it | |||
| 56 | terminates a statement. To support these variations, Emacs makes the | 56 | terminates a statement. To support these variations, Emacs makes the |
| 57 | choice of syntax table local to each buffer. Typically, each major | 57 | choice of syntax table local to each buffer. Typically, each major |
| 58 | mode has its own syntax table and installs that table in each buffer | 58 | mode has its own syntax table and installs that table in each buffer |
| 59 | which uses that mode. Changing this table alters the syntax in all | 59 | that uses that mode. Changing this table alters the syntax in all |
| 60 | those buffers as well as in any buffers subsequently put in that mode. | 60 | those buffers as well as in any buffers subsequently put in that mode. |
| 61 | Occasionally several similar modes share one syntax table. | 61 | Occasionally several similar modes share one syntax table. |
| 62 | @xref{Example Major Modes}, for an example of how to set up a syntax | 62 | @xref{Example Major Modes}, for an example of how to set up a syntax |
| @@ -92,14 +92,14 @@ puts each character into one class. There is no necessary relationship | |||
| 92 | between the class of a character in one syntax table and its class in | 92 | between the class of a character in one syntax table and its class in |
| 93 | any other table. | 93 | any other table. |
| 94 | 94 | ||
| 95 | Each class is designated by a mnemonic character which serves as the | 95 | Each class is designated by a mnemonic character, which serves as the |
| 96 | name of the class when you need to specify a class. Usually the | 96 | name of the class when you need to specify a class. Usually the |
| 97 | designator character is one which is frequently put in that class; | 97 | designator character is one that is frequently in that class; however, |
| 98 | however, its meaning as a designator is unvarying and independent of | 98 | its meaning as a designator is unvarying and independent of what syntax |
| 99 | what syntax that character currently has. | 99 | that character currently has. |
| 100 | 100 | ||
| 101 | @cindex syntax descriptor | 101 | @cindex syntax descriptor |
| 102 | A syntax descriptor is a Lisp string which specifies a syntax class, a | 102 | A syntax descriptor is a Lisp string that specifies a syntax class, a |
| 103 | matching character (used only for the parenthesis classes) and flags. | 103 | matching character (used only for the parenthesis classes) and flags. |
| 104 | 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 |
| 105 | character is the character to match; if it is unused, put a space there. | 105 | character is the character to match; if it is unused, put a space there. |
| @@ -121,7 +121,7 @@ comment-starter, second character of a comment-ender). | |||
| 121 | @node Syntax Class Table | 121 | @node Syntax Class Table |
| 122 | @subsection Table of Syntax Classes | 122 | @subsection Table of Syntax Classes |
| 123 | 123 | ||
| 124 | Here is a table syntax classes, the characters that stand for them, | 124 | Here is a table of syntax classes, the characters that stand for them, |
| 125 | their meanings, and examples of their use. | 125 | their meanings, and examples of their use. |
| 126 | 126 | ||
| 127 | @deffn {Syntax class} @w{whitespace character} | 127 | @deffn {Syntax class} @w{whitespace character} |
| @@ -135,7 +135,7 @@ newline and formfeed are almost always classified as whitespace. | |||
| 135 | @deffn {Syntax class} @w{word constituent} | 135 | @deffn {Syntax class} @w{word constituent} |
| 136 | @dfn{Word constituents} (designated with @samp{w}) are parts of normal | 136 | @dfn{Word constituents} (designated with @samp{w}) are parts of normal |
| 137 | English words and are typically used in variable and command names in | 137 | English words and are typically used in variable and command names in |
| 138 | programs. All upper and lower case letters and the digits are typically | 138 | programs. All upper- and lower-case letters, and the digits, are typically |
| 139 | word constituents. | 139 | word constituents. |
| 140 | @end deffn | 140 | @end deffn |
| 141 | 141 | ||
| @@ -227,8 +227,8 @@ This class is not currently used in any standard Emacs modes. | |||
| 227 | @dfn{Paired delimiter characters} (designated with @samp{$}) are like | 227 | @dfn{Paired delimiter characters} (designated with @samp{$}) are like |
| 228 | string quote characters except that the syntactic properties of the | 228 | string quote characters except that the syntactic properties of the |
| 229 | characters between the delimiters are not suppressed. Only @TeX{} mode | 229 | characters between the delimiters are not suppressed. Only @TeX{} mode |
| 230 | uses a paired identical delimiter presently---the @samp{$} that both | 230 | uses a paired delimiter presently---the @samp{$} that both enters and |
| 231 | enters and leaves math mode. | 231 | leaves math mode. |
| 232 | @end deffn | 232 | @end deffn |
| 233 | 233 | ||
| 234 | @deffn {Syntax class} @w{expression prefix} | 234 | @deffn {Syntax class} @w{expression prefix} |
| @@ -278,14 +278,14 @@ The flags for a character @var{c} are: | |||
| 278 | 278 | ||
| 279 | @itemize @bullet | 279 | @itemize @bullet |
| 280 | @item | 280 | @item |
| 281 | @samp{1} means @var{c} is the start of a two-character comment start | 281 | @samp{1} means @var{c} is the start of a two-character comment-start |
| 282 | sequence. | 282 | sequence. |
| 283 | 283 | ||
| 284 | @item | 284 | @item |
| 285 | @samp{2} means @var{c} is the second character of such a sequence. | 285 | @samp{2} means @var{c} is the second character of such a sequence. |
| 286 | 286 | ||
| 287 | @item | 287 | @item |
| 288 | @samp{3} means @var{c} is the start of a two-character comment end | 288 | @samp{3} means @var{c} is the start of a two-character comment-end |
| 289 | sequence. | 289 | sequence. |
| 290 | 290 | ||
| 291 | @item | 291 | @item |
| @@ -305,7 +305,7 @@ comment-end sequence of style ``b''. | |||
| 305 | 305 | ||
| 306 | The two comment-start sequences must begin with the same character; only | 306 | The two comment-start sequences must begin with the same character; only |
| 307 | the second character may differ. Mark the second character of the | 307 | the second character may differ. Mark the second character of the |
| 308 | ``b''-style comment start sequence with the @samp{b} flag. | 308 | ``b''-style comment-start sequence with the @samp{b} flag. |
| 309 | 309 | ||
| 310 | A comment-end sequence (one or two characters) applies to the ``b'' | 310 | A comment-end sequence (one or two characters) applies to the ``b'' |
| 311 | style if its first character has the @samp{b} flag set; otherwise, it | 311 | style if its first character has the @samp{b} flag set; otherwise, it |
| @@ -322,10 +322,25 @@ The appropriate comment syntax settings for C++ are as follows: | |||
| 322 | @samp{>b} | 322 | @samp{>b} |
| 323 | @end table | 323 | @end table |
| 324 | 324 | ||
| 325 | Thus @samp{/*} is a comment-start sequence for ``a'' style, @samp{//} | 325 | This defines four comment-delimiting sequences: |
| 326 | is a comment-start sequence for ``b'' style, @samp{*/} is a | 326 | |
| 327 | comment-end sequence for ``a'' style, and newline is a comment-end | 327 | @table @asis |
| 328 | sequence for ``b'' style. | 328 | @item @samp{/*} |
| 329 | This is a comment-start sequence for ``a'' style because the | ||
| 330 | second character, @samp{*}, does not have the @samp{b} flag. | ||
| 331 | |||
| 332 | @item @samp{//} | ||
| 333 | This is a comment-start sequence for ``b'' style because the second | ||
| 334 | character, @samp{/}, does have the @samp{b} flag. | ||
| 335 | |||
| 336 | @item @samp{*/} | ||
| 337 | This is a comment-end sequence for ``a'' style because the first | ||
| 338 | character, @samp{*}, does not have the @samp{b} flag | ||
| 339 | |||
| 340 | @item newline | ||
| 341 | This is a comment-end sequence for ``b'' style, because the newline | ||
| 342 | character has the @samp{b} flag. | ||
| 343 | @end table | ||
| 329 | 344 | ||
| 330 | @item | 345 | @item |
| 331 | @c Emacs 19 feature | 346 | @c Emacs 19 feature |
| @@ -347,7 +362,7 @@ altering syntax tables. | |||
| 347 | 362 | ||
| 348 | @defun make-syntax-table | 363 | @defun make-syntax-table |
| 349 | This function creates a new syntax table. Character codes 0 through | 364 | This function creates a new syntax table. Character codes 0 through |
| 350 | 31, and 128 through 255, are set up to inherit from the standard syntax | 365 | 31 and 128 through 255 are set up to inherit from the standard syntax |
| 351 | table. The other character codes are set up by copying what the | 366 | table. The other character codes are set up by copying what the |
| 352 | standard syntax table says about them. | 367 | standard syntax table says about them. |
| 353 | 368 | ||
| @@ -405,7 +420,7 @@ signaled if @var{char} is not a character. | |||
| 405 | ;; @r{the first character of a start-comment sequence,} | 420 | ;; @r{the first character of a start-comment sequence,} |
| 406 | ;; @r{and the second character of an end-comment sequence.} | 421 | ;; @r{and the second character of an end-comment sequence.} |
| 407 | ;; @r{This is used in C mode.} | 422 | ;; @r{This is used in C mode.} |
| 408 | (modify-syntax-entry ?/ ".13") | 423 | (modify-syntax-entry ?/ ". 14") |
| 409 | @result{} nil | 424 | @result{} nil |
| 410 | @end group | 425 | @end group |
| 411 | @end example | 426 | @end example |
| @@ -421,8 +436,8 @@ An error is signaled if @var{char} is not a character. | |||
| 421 | The following examples apply to C mode. The first example shows that | 436 | The following examples apply to C mode. The first example shows that |
| 422 | the syntax class of space is whitespace (represented by a space). The | 437 | the syntax class of space is whitespace (represented by a space). The |
| 423 | second example shows that the syntax of @samp{/} is punctuation. This | 438 | second example shows that the syntax of @samp{/} is punctuation. This |
| 424 | does not show the fact that it is also part of comment start and end | 439 | does not show the fact that it is also part of comment-start and -end |
| 425 | sequence. The third example shows that open parenthesis is in the class | 440 | sequences. The third example shows that open parenthesis is in the class |
| 426 | of open parentheses. This does not show the fact that it has a matching | 441 | of open parentheses. This does not show the fact that it has a matching |
| 427 | character, @samp{)}. | 442 | character, @samp{)}. |
| 428 | 443 | ||
| @@ -464,7 +479,7 @@ version 18 or earlier. | |||
| 464 | @defun skip-syntax-forward syntaxes &optional limit | 479 | @defun skip-syntax-forward syntaxes &optional limit |
| 465 | This function moves point forward across characters having syntax classes | 480 | This function moves point forward across characters having syntax classes |
| 466 | mentioned in @var{syntaxes}. It stops when it encounters the end of | 481 | mentioned in @var{syntaxes}. It stops when it encounters the end of |
| 467 | the buffer, or position @var{lim} (if specified), or a character it is | 482 | the buffer, or position @var{limit} (if specified), or a character it is |
| 468 | not supposed to skip. | 483 | not supposed to skip. |
| 469 | @ignore @c may want to change this. | 484 | @ignore @c may want to change this. |
| 470 | The return value is the distance traveled, which is a nonnegative | 485 | The return value is the distance traveled, which is a nonnegative |
| @@ -475,7 +490,7 @@ integer. | |||
| 475 | @defun skip-syntax-backward syntaxes &optional limit | 490 | @defun skip-syntax-backward syntaxes &optional limit |
| 476 | This function moves point backward across characters whose syntax | 491 | This function moves point backward across characters whose syntax |
| 477 | classes are mentioned in @var{syntaxes}. It stops when it encounters | 492 | classes are mentioned in @var{syntaxes}. It stops when it encounters |
| 478 | the beginning of the buffer, or position @var{lim} (if specified), or a | 493 | the beginning of the buffer, or position @var{limit} (if specified), or a |
| 479 | character it is not supposed to skip. | 494 | character it is not supposed to skip. |
| 480 | @ignore @c may want to change this. | 495 | @ignore @c may want to change this. |
| 481 | The return value indicates the distance traveled. It is an integer that | 496 | The return value indicates the distance traveled. It is an integer that |
| @@ -501,10 +516,10 @@ higher-level functions for moving over balanced expressions. | |||
| 501 | 516 | ||
| 502 | @defun parse-partial-sexp start limit &optional target-depth stop-before state stop-comment | 517 | @defun parse-partial-sexp start limit &optional target-depth stop-before state stop-comment |
| 503 | This function parses a sexp in the current buffer starting at | 518 | This function parses a sexp in the current buffer starting at |
| 504 | @var{start}, not scanning past @var{limit}. It stops at @var{limit} or | 519 | @var{start}, not scanning past @var{limit}. It stops at position |
| 505 | when certain criteria described below are met, and sets to the location | 520 | @var{limit} or when certain criteria described below are met, and sets |
| 506 | where parsing stops. It returns a value describing the status of the | 521 | point to the location where parsing stops. It returns a value |
| 507 | parse at the point where it stops. | 522 | describing the status of the parse at the point where it stops. |
| 508 | 523 | ||
| 509 | If @var{state} is @code{nil}, @var{start} is assumed to be at the top | 524 | If @var{state} is @code{nil}, @var{start} is assumed to be at the top |
| 510 | level of parenthesis structure, such as the beginning of a function | 525 | level of parenthesis structure, such as the beginning of a function |
| @@ -537,8 +552,8 @@ The depth in parentheses, counting from 0. | |||
| 537 | 552 | ||
| 538 | @item | 553 | @item |
| 539 | @cindex innermost containing parentheses | 554 | @cindex innermost containing parentheses |
| 540 | The character position of the start of the innermost containing | 555 | The character position of the start of the innermost parenthetical |
| 541 | parenthetical grouping; @code{nil} if none. | 556 | grouping containing the stopping point; @code{nil} if none. |
| 542 | 557 | ||
| 543 | @item | 558 | @item |
| 544 | @cindex previous complete subexpression | 559 | @cindex previous complete subexpression |
| @@ -552,7 +567,7 @@ character that will terminate the string. | |||
| 552 | 567 | ||
| 553 | @item | 568 | @item |
| 554 | @cindex inside comment | 569 | @cindex inside comment |
| 555 | @code{t} if inside a comment. | 570 | @code{t} if inside a comment (of either style). |
| 556 | 571 | ||
| 557 | @item | 572 | @item |
| 558 | @cindex quote character | 573 | @cindex quote character |
| @@ -581,14 +596,15 @@ If @var{depth} is nonzero, parenthesis depth counting begins from that | |||
| 581 | value. The only candidates for stopping are places where the depth in | 596 | value. The only candidates for stopping are places where the depth in |
| 582 | parentheses becomes zero; @code{scan-lists} counts @var{count} such | 597 | parentheses becomes zero; @code{scan-lists} counts @var{count} such |
| 583 | places and then stops. Thus, a positive value for @var{depth} means go | 598 | places and then stops. Thus, a positive value for @var{depth} means go |
| 584 | out levels of parenthesis. | 599 | out @var{depth} levels of parenthesis. |
| 585 | 600 | ||
| 586 | Scanning ignores comments if @code{parse-sexp-ignore-comments} is | 601 | Scanning ignores comments if @code{parse-sexp-ignore-comments} is |
| 587 | non-@code{nil}. | 602 | non-@code{nil}. |
| 588 | 603 | ||
| 589 | If scan reaches the beginning or end of the buffer (or its accessible | 604 | If the scan reaches the beginning or end of the buffer (or its |
| 590 | portion), and the depth is not zero, an error is signaled. If the depth | 605 | accessible portion), and the depth is not zero, an error is signaled. |
| 591 | is zero but the count is not used up, @code{nil} is returned. | 606 | If the depth is zero but the count is not used up, @code{nil} is |
| 607 | returned. | ||
| 592 | @end defun | 608 | @end defun |
| 593 | 609 | ||
| 594 | @defun scan-sexps from count | 610 | @defun scan-sexps from count |
| @@ -598,7 +614,7 @@ This function scans forward @var{count} sexps from character position | |||
| 598 | Scanning ignores comments if @code{parse-sexp-ignore-comments} is | 614 | Scanning ignores comments if @code{parse-sexp-ignore-comments} is |
| 599 | non-@code{nil}. | 615 | non-@code{nil}. |
| 600 | 616 | ||
| 601 | If scan reaches the beginning or end of (the accessible part of) the | 617 | If the scan reaches the beginning or end of (the accessible part of) the |
| 602 | buffer in the middle of a parenthetical grouping, an error is signaled. | 618 | buffer in the middle of a parenthetical grouping, an error is signaled. |
| 603 | If it reaches the beginning or end between groupings but before count is | 619 | If it reaches the beginning or end between groupings but before count is |
| 604 | used up, @code{nil} is returned. | 620 | used up, @code{nil} is returned. |
| @@ -628,7 +644,7 @@ It also stops after satisfying @var{count}. | |||
| 628 | 644 | ||
| 629 | To move forward over all comments and whitespace following point, use | 645 | To move forward over all comments and whitespace following point, use |
| 630 | @code{(forward-comment (buffer-size))}. @code{(buffer-size)} is a good | 646 | @code{(forward-comment (buffer-size))}. @code{(buffer-size)} is a good |
| 631 | argument to use, because the number of comments to in the buffer cannot | 647 | argument to use, because the number of comments in the buffer cannot |
| 632 | exceed that many. | 648 | exceed that many. |
| 633 | 649 | ||
| 634 | @node Standard Syntax Tables | 650 | @node Standard Syntax Tables |