aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorPavel Janík2001-10-20 20:56:10 +0000
committerPavel Janík2001-10-20 20:56:10 +0000
commitfdb82f93376a6b495c573a6c788b807acffdbfa9 (patch)
tree107b731b733908446a3902f6ce0e4f2d23dcd8f9 /src/syntax.c
parentc0a53abba1d89bb487e3a38a0e7336bdce46fd1d (diff)
downloademacs-fdb82f93376a6b495c573a6c788b807acffdbfa9.tar.gz
emacs-fdb82f93376a6b495c573a6c788b807acffdbfa9.zip
Change doc-string comments to `new style' [w/`doc:' keyword].
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c366
1 files changed, 174 insertions, 192 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 6a17e659979..72df6697602 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -714,9 +714,9 @@ back_comment (from, from_byte, stop, comnested, comstyle, charpos_ptr, bytepos_p
714} 714}
715 715
716DEFUN ("syntax-table-p", Fsyntax_table_p, Ssyntax_table_p, 1, 1, 0, 716DEFUN ("syntax-table-p", Fsyntax_table_p, Ssyntax_table_p, 1, 1, 0,
717 "Return t if OBJECT is a syntax table.\n\ 717 doc: /* Return t if OBJECT is a syntax table.
718Currently, any char-table counts as a syntax table.") 718Currently, any char-table counts as a syntax table. */)
719 (object) 719 (object)
720 Lisp_Object object; 720 Lisp_Object object;
721{ 721{
722 if (CHAR_TABLE_P (object) 722 if (CHAR_TABLE_P (object)
@@ -735,26 +735,26 @@ check_syntax_table (obj)
735} 735}
736 736
737DEFUN ("syntax-table", Fsyntax_table, Ssyntax_table, 0, 0, 0, 737DEFUN ("syntax-table", Fsyntax_table, Ssyntax_table, 0, 0, 0,
738 "Return the current syntax table.\n\ 738 doc: /* Return the current syntax table.
739This is the one specified by the current buffer.") 739This is the one specified by the current buffer. */)
740 () 740 ()
741{ 741{
742 return current_buffer->syntax_table; 742 return current_buffer->syntax_table;
743} 743}
744 744
745DEFUN ("standard-syntax-table", Fstandard_syntax_table, 745DEFUN ("standard-syntax-table", Fstandard_syntax_table,
746 Sstandard_syntax_table, 0, 0, 0, 746 Sstandard_syntax_table, 0, 0, 0,
747 "Return the standard syntax table.\n\ 747 doc: /* Return the standard syntax table.
748This is the one used for new buffers.") 748This is the one used for new buffers. */)
749 () 749 ()
750{ 750{
751 return Vstandard_syntax_table; 751 return Vstandard_syntax_table;
752} 752}
753 753
754DEFUN ("copy-syntax-table", Fcopy_syntax_table, Scopy_syntax_table, 0, 1, 0, 754DEFUN ("copy-syntax-table", Fcopy_syntax_table, Scopy_syntax_table, 0, 1, 0,
755 "Construct a new syntax table and return it.\n\ 755 doc: /* Construct a new syntax table and return it.
756It is a copy of the TABLE, which defaults to the standard syntax table.") 756It is a copy of the TABLE, which defaults to the standard syntax table. */)
757 (table) 757 (table)
758 Lisp_Object table; 758 Lisp_Object table;
759{ 759{
760 Lisp_Object copy; 760 Lisp_Object copy;
@@ -779,9 +779,9 @@ It is a copy of the TABLE, which defaults to the standard syntax table.")
779} 779}
780 780
781DEFUN ("set-syntax-table", Fset_syntax_table, Sset_syntax_table, 1, 1, 0, 781DEFUN ("set-syntax-table", Fset_syntax_table, Sset_syntax_table, 1, 1, 0,
782 "Select a new syntax table for the current buffer.\n\ 782 doc: /* Select a new syntax table for the current buffer.
783One argument, a syntax table.") 783One argument, a syntax table. */)
784 (table) 784 (table)
785 Lisp_Object table; 785 Lisp_Object table;
786{ 786{
787 int idx; 787 int idx;
@@ -859,12 +859,12 @@ syntax_parent_lookup (table, character)
859} 859}
860 860
861DEFUN ("char-syntax", Fchar_syntax, Schar_syntax, 1, 1, 0, 861DEFUN ("char-syntax", Fchar_syntax, Schar_syntax, 1, 1, 0,
862 "Return the syntax code of CHARACTER, described by a character.\n\ 862 doc: /* Return the syntax code of CHARACTER, described by a character.
863For example, if CHARACTER is a word constituent,\n\ 863For example, if CHARACTER is a word constituent,
864the character `w' is returned.\n\ 864the character `w' is returned.
865The characters that correspond to various syntax codes\n\ 865The characters that correspond to various syntax codes
866are listed in the documentation of `modify-syntax-entry'.") 866are listed in the documentation of `modify-syntax-entry'. */)
867 (character) 867 (character)
868 Lisp_Object character; 868 Lisp_Object character;
869{ 869{
870 int char_int; 870 int char_int;
@@ -877,8 +877,8 @@ are listed in the documentation of `modify-syntax-entry'.")
877} 877}
878 878
879DEFUN ("matching-paren", Fmatching_paren, Smatching_paren, 1, 1, 0, 879DEFUN ("matching-paren", Fmatching_paren, Smatching_paren, 1, 1, 0,
880 "Return the matching parenthesis of CHARACTER, or nil if none.") 880 doc: /* Return the matching parenthesis of CHARACTER, or nil if none. */)
881 (character) 881 (character)
882 Lisp_Object character; 882 Lisp_Object character;
883{ 883{
884 int char_int, code; 884 int char_int, code;
@@ -893,12 +893,12 @@ DEFUN ("matching-paren", Fmatching_paren, Smatching_paren, 1, 1, 0,
893} 893}
894 894
895DEFUN ("string-to-syntax", Fstring_to_syntax, Sstring_to_syntax, 1, 1, 0, 895DEFUN ("string-to-syntax", Fstring_to_syntax, Sstring_to_syntax, 1, 1, 0,
896 "Convert a syntax specification STRING into syntax cell form.\n\ 896 doc: /* Convert a syntax specification STRING into syntax cell form.
897STRING should be a string as it is allowed as argument of\n\ 897STRING should be a string as it is allowed as argument of
898`modify-syntax-entry'. Value is the equivalent cons cell\n\ 898`modify-syntax-entry'. Value is the equivalent cons cell
899\(CODE . MATCHING-CHAR) that can be used as value of a `syntax-table'\n\ 899(CODE . MATCHING-CHAR) that can be used as value of a `syntax-table'
900text property.") 900text property. */)
901 (string) 901 (string)
902 Lisp_Object string; 902 Lisp_Object string;
903{ 903{
904 register unsigned char *p; 904 register unsigned char *p;
@@ -969,56 +969,47 @@ text property.")
969 return Fcons (make_number (val), match); 969 return Fcons (make_number (val), match);
970} 970}
971 971
972/* This comment supplies the doc string for modify-syntax-entry, 972/* I really don't know why this is interactive
973 for make-docfile to see. We cannot put this in the real DEFUN 973 help-form should at least be made useful whilst reading the second arg
974 due to limits in the Unix cpp.
975
976DEFUN ("modify-syntax-entry", foo, bar, 2, 3, 0,
977 "Set syntax for character CHAR according to string S.\n\
978The syntax is changed only for table TABLE, which defaults to\n\
979 the current buffer's syntax table.\n\
980The first character of S should be one of the following:\n\
981 Space or - whitespace syntax. w word constituent.\n\
982 _ symbol constituent. . punctuation.\n\
983 ( open-parenthesis. ) close-parenthesis.\n\
984 \" string quote. \\ escape.\n\
985 $ paired delimiter. ' expression quote or prefix operator.\n\
986 < comment starter. > comment ender.\n\
987 / character-quote. @ inherit from `standard-syntax-table'.\n\
988 | generic string fence. ! generic comment fence.\n\
989\n\
990Only single-character comment start and end sequences are represented thus.\n\
991Two-character sequences are represented as described below.\n\
992The second character of S is the matching parenthesis,\n\
993 used only if the first character is `(' or `)'.\n\
994Any additional characters are flags.\n\
995Defined flags are the characters 1, 2, 3, 4, b, p, and n.\n\
996 1 means CHAR is the start of a two-char comment start sequence.\n\
997 2 means CHAR is the second character of such a sequence.\n\
998 3 means CHAR is the start of a two-char comment end sequence.\n\
999 4 means CHAR is the second character of such a sequence.\n\
1000\n\
1001There can be up to two orthogonal comment sequences. This is to support\n\
1002language modes such as C++. By default, all comment sequences are of style\n\
1003a, but you can set the comment sequence style to b (on the second character\n\
1004of a comment-start, or the first character of a comment-end sequence) using\n\
1005this flag:\n\
1006 b means CHAR is part of comment sequence b.\n\
1007 n means CHAR is part of a nestable comment sequence.\n\
1008\n\
1009 p means CHAR is a prefix character for `backward-prefix-chars';\n\
1010 such characters are treated as whitespace when they occur\n\
1011 between expressions.")
1012 (char, s, table)
1013*/ 974*/
1014
1015DEFUN ("modify-syntax-entry", Fmodify_syntax_entry, Smodify_syntax_entry, 2, 3, 975DEFUN ("modify-syntax-entry", Fmodify_syntax_entry, Smodify_syntax_entry, 2, 3,
1016 /* I really don't know why this is interactive
1017 help-form should at least be made useful whilst reading the second arg
1018 */
1019 "cSet syntax for character: \nsSet syntax for %s to: ", 976 "cSet syntax for character: \nsSet syntax for %s to: ",
1020 0 /* See immediately above */) 977 doc: /* Set syntax for character C according to string NEWENTRY.
1021 (c, newentry, syntax_table) 978The syntax is changed only for table SYNTAX_TABLE, which defaults to
979 the current buffer's syntax table.
980The first character of NEWENTRY should be one of the following:
981 Space or - whitespace syntax. w word constituent.
982 _ symbol constituent. . punctuation.
983 ( open-parenthesis. ) close-parenthesis.
984 " string quote. \\ escape.
985 $ paired delimiter. ' expression quote or prefix operator.
986 < comment starter. > comment ender.
987 / character-quote. @ inherit from `standard-syntax-table'.
988 | generic string fence. ! generic comment fence.
989
990Only single-character comment start and end sequences are represented thus.
991Two-character sequences are represented as described below.
992The second character of NEWENTRY is the matching parenthesis,
993 used only if the first character is `(' or `)'.
994Any additional characters are flags.
995Defined flags are the characters 1, 2, 3, 4, b, p, and n.
996 1 means C is the start of a two-char comment start sequence.
997 2 means C is the second character of such a sequence.
998 3 means C is the start of a two-char comment end sequence.
999 4 means C is the second character of such a sequence.
1000
1001There can be up to two orthogonal comment sequences. This is to support
1002language modes such as C++. By default, all comment sequences are of style
1003a, but you can set the comment sequence style to b (on the second character
1004of a comment-start, or the first character of a comment-end sequence) using
1005this flag:
1006 b means C is part of comment sequence b.
1007 n means C is part of a nestable comment sequence.
1008
1009 p means C is a prefix character for `backward-prefix-chars';
1010 such characters are treated as whitespace when they occur
1011 between expressions. */)
1012 (c, newentry, syntax_table)
1022 Lisp_Object c, newentry, syntax_table; 1013 Lisp_Object c, newentry, syntax_table;
1023{ 1014{
1024 CHECK_NUMBER (c, 0); 1015 CHECK_NUMBER (c, 0);
@@ -1201,9 +1192,9 @@ describe_syntax_1 (vector)
1201} 1192}
1202 1193
1203DEFUN ("describe-syntax", Fdescribe_syntax, Sdescribe_syntax, 0, 0, "", 1194DEFUN ("describe-syntax", Fdescribe_syntax, Sdescribe_syntax, 0, 0, "",
1204 "Describe the syntax specifications in the syntax table.\n\ 1195 doc: /* Describe the syntax specifications in the syntax table.
1205The descriptions are inserted in a buffer, which is then displayed.") 1196The descriptions are inserted in a buffer, which is then displayed. */)
1206 () 1197 ()
1207{ 1198{
1208 internal_with_output_to_temp_buffer 1199 internal_with_output_to_temp_buffer
1209 ("*Help*", describe_syntax_1, current_buffer->syntax_table); 1200 ("*Help*", describe_syntax_1, current_buffer->syntax_table);
@@ -1315,12 +1306,12 @@ scan_words (from, count)
1315} 1306}
1316 1307
1317DEFUN ("forward-word", Fforward_word, Sforward_word, 1, 1, "p", 1308DEFUN ("forward-word", Fforward_word, Sforward_word, 1, 1, "p",
1318 "Move point forward ARG words (backward if ARG is negative).\n\ 1309 doc: /* Move point forward ARG words (backward if ARG is negative).
1319Normally returns t.\n\ 1310Normally returns t.
1320If an edge of the buffer or a field boundary is reached, point is left there\n\ 1311If an edge of the buffer or a field boundary is reached, point is left there
1321and the function returns nil. Field boundaries are not noticed if\n\ 1312and the function returns nil. Field boundaries are not noticed if
1322`inhibit-field-text-motion' is non-nil.") 1313`inhibit-field-text-motion' is non-nil. */)
1323 (count) 1314 (count)
1324 Lisp_Object count; 1315 Lisp_Object count;
1325{ 1316{
1326 int orig_val, val; 1317 int orig_val, val;
@@ -1341,48 +1332,48 @@ and the function returns nil. Field boundaries are not noticed if\n\
1341Lisp_Object skip_chars (); 1332Lisp_Object skip_chars ();
1342 1333
1343DEFUN ("skip-chars-forward", Fskip_chars_forward, Sskip_chars_forward, 1, 2, 0, 1334DEFUN ("skip-chars-forward", Fskip_chars_forward, Sskip_chars_forward, 1, 2, 0,
1344 "Move point forward, stopping before a char not in STRING, or at pos LIM.\n\ 1335 doc: /* Move point forward, stopping before a char not in STRING, or at pos LIM.
1345STRING is like the inside of a `[...]' in a regular expression\n\ 1336STRING is like the inside of a `[...]' in a regular expression
1346except that `]' is never special and `\\' quotes `^', `-' or `\\'\n\ 1337except that `]' is never special and `\\' quotes `^', `-' or `\\'
1347 (but not as the end of a range; quoting is never needed there).\n\ 1338 (but not as the end of a range; quoting is never needed there).
1348Thus, with arg \"a-zA-Z\", this skips letters stopping before first nonletter.\n\ 1339Thus, with arg "a-zA-Z", this skips letters stopping before first nonletter.
1349With arg \"^a-zA-Z\", skips nonletters stopping before first letter.\n\ 1340With arg "^a-zA-Z", skips nonletters stopping before first letter.
1350Returns the distance traveled, either zero or positive.") 1341Returns the distance traveled, either zero or positive. */)
1351 (string, lim) 1342 (string, lim)
1352 Lisp_Object string, lim; 1343 Lisp_Object string, lim;
1353{ 1344{
1354 return skip_chars (1, 0, string, lim); 1345 return skip_chars (1, 0, string, lim);
1355} 1346}
1356 1347
1357DEFUN ("skip-chars-backward", Fskip_chars_backward, Sskip_chars_backward, 1, 2, 0, 1348DEFUN ("skip-chars-backward", Fskip_chars_backward, Sskip_chars_backward, 1, 2, 0,
1358 "Move point backward, stopping after a char not in STRING, or at pos LIM.\n\ 1349 doc: /* Move point backward, stopping after a char not in STRING, or at pos LIM.
1359See `skip-chars-forward' for details.\n\ 1350See `skip-chars-forward' for details.
1360Returns the distance traveled, either zero or negative.") 1351Returns the distance traveled, either zero or negative. */)
1361 (string, lim) 1352 (string, lim)
1362 Lisp_Object string, lim; 1353 Lisp_Object string, lim;
1363{ 1354{
1364 return skip_chars (0, 0, string, lim); 1355 return skip_chars (0, 0, string, lim);
1365} 1356}
1366 1357
1367DEFUN ("skip-syntax-forward", Fskip_syntax_forward, Sskip_syntax_forward, 1, 2, 0, 1358DEFUN ("skip-syntax-forward", Fskip_syntax_forward, Sskip_syntax_forward, 1, 2, 0,
1368 "Move point forward across chars in specified syntax classes.\n\ 1359 doc: /* Move point forward across chars in specified syntax classes.
1369SYNTAX is a string of syntax code characters.\n\ 1360SYNTAX is a string of syntax code characters.
1370Stop before a char whose syntax is not in SYNTAX, or at position LIM.\n\ 1361Stop before a char whose syntax is not in SYNTAX, or at position LIM.
1371If SYNTAX starts with ^, skip characters whose syntax is NOT in SYNTAX.\n\ 1362If SYNTAX starts with ^, skip characters whose syntax is NOT in SYNTAX.
1372This function returns the distance traveled, either zero or positive.") 1363This function returns the distance traveled, either zero or positive. */)
1373 (syntax, lim) 1364 (syntax, lim)
1374 Lisp_Object syntax, lim; 1365 Lisp_Object syntax, lim;
1375{ 1366{
1376 return skip_chars (1, 1, syntax, lim); 1367 return skip_chars (1, 1, syntax, lim);
1377} 1368}
1378 1369
1379DEFUN ("skip-syntax-backward", Fskip_syntax_backward, Sskip_syntax_backward, 1, 2, 0, 1370DEFUN ("skip-syntax-backward", Fskip_syntax_backward, Sskip_syntax_backward, 1, 2, 0,
1380 "Move point backward across chars in specified syntax classes.\n\ 1371 doc: /* Move point backward across chars in specified syntax classes.
1381SYNTAX is a string of syntax code characters.\n\ 1372SYNTAX is a string of syntax code characters.
1382Stop on reaching a char whose syntax is not in SYNTAX, or at position LIM.\n\ 1373Stop on reaching a char whose syntax is not in SYNTAX, or at position LIM.
1383If SYNTAX starts with ^, skip characters whose syntax is NOT in SYNTAX.\n\ 1374If SYNTAX starts with ^, skip characters whose syntax is NOT in SYNTAX.
1384This function returns the distance traveled, either zero or negative.") 1375This function returns the distance traveled, either zero or negative. */)
1385 (syntax, lim) 1376 (syntax, lim)
1386 Lisp_Object syntax, lim; 1377 Lisp_Object syntax, lim;
1387{ 1378{
1388 return skip_chars (0, 1, syntax, lim); 1379 return skip_chars (0, 1, syntax, lim);
@@ -1811,12 +1802,12 @@ forw_comment (from, from_byte, stop, nesting, style, prev_syntax,
1811} 1802}
1812 1803
1813DEFUN ("forward-comment", Fforward_comment, Sforward_comment, 1, 1, 0, 1804DEFUN ("forward-comment", Fforward_comment, Sforward_comment, 1, 1, 0,
1814 "Move forward across up to N comments. If N is negative, move backward.\n\ 1805 doc: /* Move forward across up to N comments. If N is negative, move backward.
1815Stop scanning if we find something other than a comment or whitespace.\n\ 1806Stop scanning if we find something other than a comment or whitespace.
1816Set point to where scanning stops.\n\ 1807Set point to where scanning stops.
1817If N comments are found as expected, with nothing except whitespace\n\ 1808If N comments are found as expected, with nothing except whitespace
1818between them, return t; otherwise return nil.") 1809between them, return t; otherwise return nil. */)
1819 (count) 1810 (count)
1820 Lisp_Object count; 1811 Lisp_Object count;
1821{ 1812{
1822 register int from; 1813 register int from;
@@ -2399,20 +2390,20 @@ scan_lists (from, count, depth, sexpflag)
2399} 2390}
2400 2391
2401DEFUN ("scan-lists", Fscan_lists, Sscan_lists, 3, 3, 0, 2392DEFUN ("scan-lists", Fscan_lists, Sscan_lists, 3, 3, 0,
2402 "Scan from character number FROM by COUNT lists.\n\ 2393 doc: /* Scan from character number FROM by COUNT lists.
2403Returns the character number of the position thus found.\n\ 2394Returns the character number of the position thus found.
2404\n\ 2395
2405If DEPTH is nonzero, paren depth begins counting from that value,\n\ 2396If DEPTH is nonzero, paren depth begins counting from that value,
2406only places where the depth in parentheses becomes zero\n\ 2397only places where the depth in parentheses becomes zero
2407are candidates for stopping; COUNT such places are counted.\n\ 2398are candidates for stopping; COUNT such places are counted.
2408Thus, a positive value for DEPTH means go out levels.\n\ 2399Thus, a positive value for DEPTH means go out levels.
2409\n\ 2400
2410Comments are ignored if `parse-sexp-ignore-comments' is non-nil.\n\ 2401Comments are ignored if `parse-sexp-ignore-comments' is non-nil.
2411\n\ 2402
2412If the beginning or end of (the accessible part of) the buffer is reached\n\ 2403If the beginning or end of (the accessible part of) the buffer is reached
2413and the depth is wrong, an error is signaled.\n\ 2404and the depth is wrong, an error is signaled.
2414If the depth is right but the count is not used up, nil is returned.") 2405If the depth is right but the count is not used up, nil is returned. */)
2415 (from, count, depth) 2406 (from, count, depth)
2416 Lisp_Object from, count, depth; 2407 Lisp_Object from, count, depth;
2417{ 2408{
2418 CHECK_NUMBER (from, 0); 2409 CHECK_NUMBER (from, 0);
@@ -2423,17 +2414,17 @@ If the depth is right but the count is not used up, nil is returned.")
2423} 2414}
2424 2415
2425DEFUN ("scan-sexps", Fscan_sexps, Sscan_sexps, 2, 2, 0, 2416DEFUN ("scan-sexps", Fscan_sexps, Sscan_sexps, 2, 2, 0,
2426 "Scan from character number FROM by COUNT balanced expressions.\n\ 2417 doc: /* Scan from character number FROM by COUNT balanced expressions.
2427If COUNT is negative, scan backwards.\n\ 2418If COUNT is negative, scan backwards.
2428Returns the character number of the position thus found.\n\ 2419Returns the character number of the position thus found.
2429\n\ 2420
2430Comments are ignored if `parse-sexp-ignore-comments' is non-nil.\n\ 2421Comments are ignored if `parse-sexp-ignore-comments' is non-nil.
2431\n\ 2422
2432If the beginning or end of (the accessible part of) the buffer is reached\n\ 2423If the beginning or end of (the accessible part of) the buffer is reached
2433in the middle of a parenthetical grouping, an error is signaled.\n\ 2424in the middle of a parenthetical grouping, an error is signaled.
2434If the beginning or end is reached between groupings\n\ 2425If the beginning or end is reached between groupings
2435but before count is used up, nil is returned.") 2426but before count is used up, nil is returned. */)
2436 (from, count) 2427 (from, count)
2437 Lisp_Object from, count; 2428 Lisp_Object from, count;
2438{ 2429{
2439 CHECK_NUMBER (from, 0); 2430 CHECK_NUMBER (from, 0);
@@ -2443,10 +2434,10 @@ but before count is used up, nil is returned.")
2443} 2434}
2444 2435
2445DEFUN ("backward-prefix-chars", Fbackward_prefix_chars, Sbackward_prefix_chars, 2436DEFUN ("backward-prefix-chars", Fbackward_prefix_chars, Sbackward_prefix_chars,
2446 0, 0, 0, 2437 0, 0, 0,
2447 "Move point backward over any number of chars with prefix syntax.\n\ 2438 doc: /* Move point backward over any number of chars with prefix syntax.
2448This includes chars with \"quote\" or \"prefix\" syntax (' or p).") 2439This includes chars with "quote" or "prefix" syntax (' or p). */)
2449 () 2440 ()
2450{ 2441{
2451 int beg = BEGV; 2442 int beg = BEGV;
2452 int opoint = PT; 2443 int opoint = PT;
@@ -2836,47 +2827,38 @@ do { prev_from = from; \
2836 *stateptr = state; 2827 *stateptr = state;
2837} 2828}
2838 2829
2839/* This comment supplies the doc string for parse-partial-sexp,
2840 for make-docfile to see. We cannot put this in the real DEFUN
2841 due to limits in the Unix cpp.
2842
2843DEFUN ("parse-partial-sexp", Ffoo, Sfoo, 2, 6, 0,
2844 "Parse Lisp syntax starting at FROM until TO; return status of parse at TO.\n\
2845Parsing stops at TO or when certain criteria are met;\n\
2846 point is set to where parsing stops.\n\
2847If fifth arg STATE is omitted or nil,\n\
2848 parsing assumes that FROM is the beginning of a function.\n\
2849Value is a list of ten elements describing final state of parsing:\n\
2850 0. depth in parens.\n\
2851 1. character address of start of innermost containing list; nil if none.\n\
2852 2. character address of start of last complete sexp terminated.\n\
2853 3. non-nil if inside a string.\n\
2854 (it is the character that will terminate the string,\n\
2855 or t if the string should be terminated by a generic string delimiter.)\n\
2856 4. nil if outside a comment, t if inside a non-nestable comment, \n\
2857 else an integer (the current comment nesting).\n\
2858 5. t if following a quote character.\n\
2859 6. the minimum paren-depth encountered during this scan.\n\
2860 7. t if in a comment of style b; symbol `syntax-table' if the comment\n\
2861 should be terminated by a generic comment delimiter.\n\
2862 8. character address of start of comment or string; nil if not in one.\n\
2863 9. Intermediate data for continuation of parsing (subject to change).\n\
2864If third arg TARGETDEPTH is non-nil, parsing stops if the depth\n\
2865in parentheses becomes equal to TARGETDEPTH.\n\
2866Fourth arg STOPBEFORE non-nil means stop when come to\n\
2867 any character that starts a sexp.\n\
2868Fifth arg STATE is a nine-element list like what this function returns.\n\
2869 It is used to initialize the state of the parse. Elements number 1, 2, 6\n\
2870 and 8 are ignored; you can leave off element 8 (the last) entirely.\n\
2871Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.\n\
2872 If it is symbol `syntax-table', stop after the start of a comment or a\n\
2873 string, or after end of a comment or a string.")
2874 (from, to, targetdepth, stopbefore, state, commentstop)
2875*/
2876
2877DEFUN ("parse-partial-sexp", Fparse_partial_sexp, Sparse_partial_sexp, 2, 6, 0, 2830DEFUN ("parse-partial-sexp", Fparse_partial_sexp, Sparse_partial_sexp, 2, 6, 0,
2878 0 /* See immediately above */) 2831 doc: /* Parse Lisp syntax starting at FROM until TO; return status of parse at TO.
2879 (from, to, targetdepth, stopbefore, oldstate, commentstop) 2832Parsing stops at TO or when certain criteria are met;
2833 point is set to where parsing stops.
2834If fifth arg OLDSTATE is omitted or nil,
2835 parsing assumes that FROM is the beginning of a function.
2836Value is a list of ten elements describing final state of parsing:
2837 0. depth in parens.
2838 1. character address of start of innermost containing list; nil if none.
2839 2. character address of start of last complete sexp terminated.
2840 3. non-nil if inside a string.
2841 (it is the character that will terminate the string,
2842 or t if the string should be terminated by a generic string delimiter.)
2843 4. nil if outside a comment, t if inside a non-nestable comment,
2844 else an integer (the current comment nesting).
2845 5. t if following a quote character.
2846 6. the minimum paren-depth encountered during this scan.
2847 7. t if in a comment of style b; symbol `syntax-table' if the comment
2848 should be terminated by a generic comment delimiter.
2849 8. character address of start of comment or string; nil if not in one.
2850 9. Intermediate data for continuation of parsing (subject to change).
2851If third arg TARGETDEPTH is non-nil, parsing stops if the depth
2852in parentheses becomes equal to TARGETDEPTH.
2853Fourth arg STOPBEFORE non-nil means stop when come to
2854 any character that starts a sexp.
2855Fifth arg OLDSTATE is a nine-element list like what this function returns.
2856 It is used to initialize the state of the parse. Elements number 1, 2, 6
2857 and 8 are ignored; you can leave off element 8 (the last) entirely.
2858Sixth arg COMMENTSTOP non-nil means stop at the start of a comment.
2859 If it is symbol `syntax-table', stop after the start of a comment or a
2860 string, or after end of a comment or a string. */)
2861 (from, to, targetdepth, stopbefore, oldstate, commentstop)
2880 Lisp_Object from, to, targetdepth, stopbefore, oldstate, commentstop; 2862 Lisp_Object from, to, targetdepth, stopbefore, oldstate, commentstop;
2881{ 2863{
2882 struct lisp_parse_state state; 2864 struct lisp_parse_state state;
@@ -3014,25 +2996,25 @@ syms_of_syntax ()
3014 build_string ("Scan error")); 2996 build_string ("Scan error"));
3015 2997
3016 DEFVAR_BOOL ("parse-sexp-ignore-comments", &parse_sexp_ignore_comments, 2998 DEFVAR_BOOL ("parse-sexp-ignore-comments", &parse_sexp_ignore_comments,
3017 "Non-nil means `forward-sexp', etc., should treat comments as whitespace."); 2999 doc: /* Non-nil means `forward-sexp', etc., should treat comments as whitespace. */);
3018 3000
3019 DEFVAR_BOOL ("parse-sexp-lookup-properties", &parse_sexp_lookup_properties, 3001 DEFVAR_BOOL ("parse-sexp-lookup-properties", &parse_sexp_lookup_properties,
3020 "Non-nil means `forward-sexp', etc., obey `syntax-table' property.\n\ 3002 doc: /* Non-nil means `forward-sexp', etc., obey `syntax-table' property.
3021Otherwise, that text property is simply ignored.\n\ 3003Otherwise, that text property is simply ignored.
3022See the info node `(elisp)Syntax Properties' for a description of the\n\ 3004See the info node `(elisp)Syntax Properties' for a description of the
3023`syntax-table' property."); 3005`syntax-table' property. */);
3024 3006
3025 words_include_escapes = 0; 3007 words_include_escapes = 0;
3026 DEFVAR_BOOL ("words-include-escapes", &words_include_escapes, 3008 DEFVAR_BOOL ("words-include-escapes", &words_include_escapes,
3027 "Non-nil means `forward-word', etc., should treat escape chars part of words."); 3009 doc: /* Non-nil means `forward-word', etc., should treat escape chars part of words. */);
3028 3010
3029 DEFVAR_BOOL ("multibyte-syntax-as-symbol", &multibyte_syntax_as_symbol, 3011 DEFVAR_BOOL ("multibyte-syntax-as-symbol", &multibyte_syntax_as_symbol,
3030 "Non-nil means `scan-sexps' treats all multibyte characters as symbol."); 3012 doc: /* Non-nil means `scan-sexps' treats all multibyte characters as symbol. */);
3031 multibyte_syntax_as_symbol = 0; 3013 multibyte_syntax_as_symbol = 0;
3032 3014
3033 DEFVAR_BOOL ("open-paren-in-column-0-is-defun-start", 3015 DEFVAR_BOOL ("open-paren-in-column-0-is-defun-start",
3034 &open_paren_in_column_0_is_defun_start, 3016 &open_paren_in_column_0_is_defun_start,
3035 "Non-nil means an open paren in column 0 denotes the start of a defun."); 3017 doc: /* Non-nil means an open paren in column 0 denotes the start of a defun. */);
3036 open_paren_in_column_0_is_defun_start = 1; 3018 open_paren_in_column_0_is_defun_start = 1;
3037 3019
3038 defsubr (&Ssyntax_table_p); 3020 defsubr (&Ssyntax_table_p);