annotate src/syntax.h @ 17692:426dde653028 gnumach-release-1-1 gnumach-release-1-1-1 libc-970508 libc-970509 libc-970510 libc-970511 libc-970512 libc-970513 libc-970514 libc-970515 libc-970516 libc-970517 libc-970518 libc-970519 libc-970520 libc-970521 libc-970522 libc-970523 libc-970524 libc-970525 libc-970526 libc-970527 libc-970528 libc-970529 libc-970530 libc-970531 libc-970601 libc-970602 libc-970603 libc-970604 libc-970605

Recognize either / or - as a machine/suptype separator from uname -m to cope with older systems that have the older uname.
author Thomas Bushnell, BSG <thomas@gnu.org>
date Wed, 07 May 1997 19:19:04 +0000
parents 8a008f65c8d4
children 614b916ff5bf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 /* Declarations having to do with GNU Emacs syntax tables.
17465
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
2 Copyright (C) 1985, 1993, 1994, 1997 Free Software Foundation, Inc.
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4 This file is part of GNU Emacs.
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 GNU Emacs is free software; you can redistribute it and/or modify
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
12244
ac7375e60931 Update GPL to version 2.
Karl Heuer <kwzh@gnu.org>
parents: 7967
diff changeset
8 the Free Software Foundation; either version 2, or (at your option)
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 any later version.
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 GNU Emacs is distributed in the hope that it will be useful,
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 GNU General Public License for more details.
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 along with GNU Emacs; see the file COPYING. If not, write to
14186
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13827
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
ee40177f6c68 Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents: 13827
diff changeset
19 Boston, MA 02111-1307, USA. */
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 extern Lisp_Object Qsyntax_table_p;
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 extern Lisp_Object Fsyntax_table_p (), Fsyntax_table (), Fset_syntax_table ();
17465
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
24 extern void update_syntax_table ();
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26 /* The standard syntax table is stored where it will automatically
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 be used in all new buffers. */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 #define Vstandard_syntax_table buffer_defaults.syntax_table
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
30 /* A syntax table is a chartable whose elements are cons cells
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
31 (CODE+FLAGS . MATCHING-CHAR). MATCHING-CHAR can be nil if the char
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
32 is not a kind of parenthesis.
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
34 The low 8 bits of CODE+FLAGS is a code, as follows: */
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 enum syntaxcode
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 {
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 Swhitespace, /* for a whitespace character */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 Spunct, /* for random punctuation characters */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 Sword, /* for a word constituent */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 Ssymbol, /* symbol constituent but not word constituent */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 Sopen, /* for a beginning delimiter */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 Sclose, /* for an ending delimiter */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 Squote, /* for a prefix character like Lisp ' */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 Sstring, /* for a string-grouping character like Lisp " */
17465
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
46 Smath, /* for delimiters like $ in Tex. */
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 Sescape, /* for a character that begins a C-style escape */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 Scharquote, /* for a character that quotes the following character */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 Scomment, /* for a comment-starting character */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 Sendcomment, /* for a comment-ending character */
5441
0af9674da850 (enum syntaxcode): Add Sinherit.
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
51 Sinherit, /* use the standard syntax table for this character */
17465
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
52 Scomment_fence, /* Starts/ends comment which is delimited on the
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
53 other side by a char with the same syntaxcode. */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
54 Sstring_fence, /* Starts/ends string which is delimited on the
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
55 other side by a char with the same syntaxcode. */
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 Smax /* Upper bound on codes that are meaningful */
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57 };
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58
17045
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
59 /* Set the syntax entry VAL for char C in table TABLE. */
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
60
17127
ab43d13fdfd5 (SET_RAW_SYNTAX_ENTRY, SYNTAX_ENTRY): Cast arg C to
Kenichi Handa <handa@m17n.org>
parents: 17045
diff changeset
61 #define SET_RAW_SYNTAX_ENTRY(table, c, val) \
17181
156896ccc86e (SET_RAW_SYNTAX_ENTRY, SYNTAX_ENTRY): Adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents: 17127
diff changeset
62 ((c) < CHAR_TABLE_SINGLE_BYTE_SLOTS \
17127
ab43d13fdfd5 (SET_RAW_SYNTAX_ENTRY, SYNTAX_ENTRY): Cast arg C to
Kenichi Handa <handa@m17n.org>
parents: 17045
diff changeset
63 ? (XCHAR_TABLE (table)->contents[(unsigned char) (c)] = (val)) \
ab43d13fdfd5 (SET_RAW_SYNTAX_ENTRY, SYNTAX_ENTRY): Cast arg C to
Kenichi Handa <handa@m17n.org>
parents: 17045
diff changeset
64 : Faset ((table), make_number (c), (val)))
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65
17045
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
66 /* Fetch the syntax entry for char C in syntax table TABLE.
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
67 This macro is called only when C is less than CHAR_TABLE_ORDINARY_SLOTS.
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
68 Do inheritance. */
5441
0af9674da850 (enum syntaxcode): Add Sinherit.
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
69
0af9674da850 (enum syntaxcode): Add Sinherit.
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
70 #ifdef __GNUC__
17045
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
71 #define SYNTAX_ENTRY_FOLLOW_PARENT(table, c) \
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
72 ({ Lisp_Object tbl = table; \
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
73 Lisp_Object temp = XCHAR_TABLE (tbl)->contents[(c)]; \
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
74 while (NILP (temp)) \
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
75 { \
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
76 tbl = XCHAR_TABLE (tbl)->parent; \
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
77 if (NILP (tbl)) \
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
78 break; \
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
79 temp = XCHAR_TABLE (tbl)->contents[(c)]; \
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
80 } \
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
81 temp; })
17045
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
82 #else
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
83 extern Lisp_Object syntax_temp;
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
84 extern Lisp_Object syntax_parent_lookup ();
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
85
17045
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
86 #define SYNTAX_ENTRY_FOLLOW_PARENT(table, c) \
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
87 (syntax_temp = XCHAR_TABLE (table)->contents[(c)], \
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
88 (NILP (syntax_temp) \
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
89 ? syntax_parent_lookup (table, (c)) \
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
90 : syntax_temp))
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
91 #endif
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
92
17465
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
93 /* SYNTAX_ENTRY fetches the information from the entry for character C
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
94 in syntax table TABLE, or from globally kept data (gl_state).
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
95 Does inheritance. */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
96 /* CURRENT_SYNTAX_TABLE gives the syntax table valid for current
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
97 position, it is either the buffer's syntax table, or syntax table
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
98 found in text properties. */
17045
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
99
17465
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
100 #ifdef SYNTAX_ENTRY_VIA_PROPERTY
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
101 # define SYNTAX_ENTRY(c) \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
102 (gl_state.use_global ? gl_state.global_code : SYNTAX_ENTRY_INT (c))
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
103 # define CURRENT_SYNTAX_TABLE gl_state.current_syntax_table
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
104 #else
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
105 # define SYNTAX_ENTRY SYNTAX_ENTRY_INT
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
106 # define CURRENT_SYNTAX_TABLE current_buffer->syntax_table
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
107 #endif
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
108
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
109 #define SYNTAX_ENTRY_INT(c) \
17181
156896ccc86e (SET_RAW_SYNTAX_ENTRY, SYNTAX_ENTRY): Adjusted for the change of
Kenichi Handa <handa@m17n.org>
parents: 17127
diff changeset
110 ((c) < CHAR_TABLE_SINGLE_BYTE_SLOTS \
17465
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
111 ? SYNTAX_ENTRY_FOLLOW_PARENT (CURRENT_SYNTAX_TABLE, \
17127
ab43d13fdfd5 (SET_RAW_SYNTAX_ENTRY, SYNTAX_ENTRY): Cast arg C to
Kenichi Handa <handa@m17n.org>
parents: 17045
diff changeset
112 (unsigned char) (c)) \
17465
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
113 : Faref (CURRENT_SYNTAX_TABLE, make_number ((c))))
17045
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
114
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
115 /* Extract the information from the entry for character C
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
116 in the current syntax table. */
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
117
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
118 #ifdef __GNUC__
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
119 #define SYNTAX(c) \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
120 ({ Lisp_Object temp; \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
121 temp = SYNTAX_ENTRY (c); \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
122 (CONSP (temp) \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
123 ? (enum syntaxcode) (XINT (XCONS (temp)->car) & 0xff) \
17045
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
124 : Swhitespace); })
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
125
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
126 #define SYNTAX_WITH_FLAGS(c) \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
127 ({ Lisp_Object temp; \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
128 temp = SYNTAX_ENTRY (c); \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
129 (CONSP (temp) \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
130 ? XINT (XCONS (temp)->car) \
17045
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
131 : (int) Swhitespace); })
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
132
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
133 #define SYNTAX_MATCH(c) \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
134 ({ Lisp_Object temp; \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
135 temp = SYNTAX_ENTRY (c); \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
136 (CONSP (temp) \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
137 ? XINT (XCONS (temp)->cdr) \
17045
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
138 : Qnil); })
5441
0af9674da850 (enum syntaxcode): Add Sinherit.
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
139 #else
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
140 #define SYNTAX(c) \
13318
94a4b6e9d310 (SYNTAX, SYNTAX_WITH_FLAGS, SYNTAX_MATCH): Fix the non-GCC definitions.
Richard M. Stallman <rms@gnu.org>
parents: 13143
diff changeset
141 (syntax_temp = SYNTAX_ENTRY ((c)), \
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
142 (CONSP (syntax_temp) \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
143 ? (enum syntaxcode) (XINT (XCONS (syntax_temp)->car) & 0xff) \
17045
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
144 : Swhitespace))
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
145
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
146 #define SYNTAX_WITH_FLAGS(c) \
13318
94a4b6e9d310 (SYNTAX, SYNTAX_WITH_FLAGS, SYNTAX_MATCH): Fix the non-GCC definitions.
Richard M. Stallman <rms@gnu.org>
parents: 13143
diff changeset
147 (syntax_temp = SYNTAX_ENTRY ((c)), \
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
148 (CONSP (syntax_temp) \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
149 ? XINT (XCONS (syntax_temp)->car) \
17045
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
150 : (int) Swhitespace))
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
151
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
152 #define SYNTAX_MATCH(c) \
13318
94a4b6e9d310 (SYNTAX, SYNTAX_WITH_FLAGS, SYNTAX_MATCH): Fix the non-GCC definitions.
Richard M. Stallman <rms@gnu.org>
parents: 13143
diff changeset
153 (syntax_temp = SYNTAX_ENTRY ((c)), \
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
154 (CONSP (syntax_temp) \
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
155 ? XINT (XCONS (syntax_temp)->cdr) \
17045
1dfa84b25d3b (SET_RAW_SYNTAX_ENTRY): Handle syntax of multibyte
Karl Heuer <kwzh@gnu.org>
parents: 14186
diff changeset
156 : Qnil))
5441
0af9674da850 (enum syntaxcode): Add Sinherit.
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
157 #endif
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
158
1073
721e4f57c8b0 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 720
diff changeset
159 /* Then there are six single-bit flags that have the following meanings:
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
160 1. This character is the first of a two-character comment-start sequence.
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
161 2. This character is the second of a two-character comment-start sequence.
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
162 3. This character is the first of a two-character comment-end sequence.
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
163 4. This character is the second of a two-character comment-end sequence.
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164 5. This character is a prefix, for backward-prefix-chars.
1073
721e4f57c8b0 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 720
diff changeset
165 Note that any two-character sequence whose first character has flag 1
721e4f57c8b0 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 720
diff changeset
166 and whose second character has flag 2 will be interpreted as a comment start.
721e4f57c8b0 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 720
diff changeset
167
721e4f57c8b0 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 720
diff changeset
168 bit 6 is used to discriminate between two different comment styles.
721e4f57c8b0 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 720
diff changeset
169 Languages such as C++ allow two orthogonal syntax start/end pairs
721e4f57c8b0 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 720
diff changeset
170 and bit 6 is used to determine whether a comment-end or Scommentend
17465
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
171 ends style a or b. Comment start sequences can start style a or b.
1073
721e4f57c8b0 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 720
diff changeset
172 Style a is always the default.
721e4f57c8b0 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 720
diff changeset
173 */
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
174
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
175 #define SYNTAX_COMSTART_FIRST(c) ((SYNTAX_WITH_FLAGS (c) >> 16) & 1)
5441
0af9674da850 (enum syntaxcode): Add Sinherit.
Richard M. Stallman <rms@gnu.org>
parents: 2961
diff changeset
176
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
177 #define SYNTAX_COMSTART_SECOND(c) ((SYNTAX_WITH_FLAGS (c) >> 17) & 1)
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
178
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
179 #define SYNTAX_COMEND_FIRST(c) ((SYNTAX_WITH_FLAGS (c) >> 18) & 1)
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
180
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
181 #define SYNTAX_COMEND_SECOND(c) ((SYNTAX_WITH_FLAGS (c) >> 19) & 1)
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
182
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
183 #define SYNTAX_PREFIX(c) ((SYNTAX_WITH_FLAGS (c) >> 20) & 1)
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
184
1073
721e4f57c8b0 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 720
diff changeset
185 /* extract the comment style bit from the syntax table entry */
13143
ba670977cceb Use char tables as syntax tables.
Richard M. Stallman <rms@gnu.org>
parents: 12244
diff changeset
186 #define SYNTAX_COMMENT_STYLE(c) ((SYNTAX_WITH_FLAGS (c) >> 21) & 1)
1073
721e4f57c8b0 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 720
diff changeset
187
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
188 /* This array, indexed by a character, contains the syntax code which that
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
189 character signifies (as a char). For example,
17465
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
190 (enum syntaxcode) syntax_spec_code['w'] is Sword. */
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
191
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
192 extern unsigned char syntax_spec_code[0400];
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
193
17465
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
194 /* Indexed by syntax code, give the letter that describes it. */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
195
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
196 extern char syntax_code_spec[16];
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
197
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
198 /* Make syntax table state (gl_state) good for POS, assuming it is
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
199 currently good for a position before POS. */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
200 #define UPDATE_SYNTAX_TABLE_FORWARD(pos) \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
201 ((pos) >= gl_state.e_property ? \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
202 ( update_syntax_table ((pos), 1, 0), 1 ) : 0)
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
203
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
204
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
205 /* Make syntax table state (gl_state) good for POS, assuming it is
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
206 currently good for a position after POS. */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
207 #define UPDATE_SYNTAX_TABLE_BACKWARD(pos) \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
208 ((pos) <= gl_state.b_property ? \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
209 ( update_syntax_table ((pos), -1, 0), 1 ) : 0)
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
210
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
211 /* Make syntax table good for POS. */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
212 #define UPDATE_SYNTAX_TABLE(pos) \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
213 ((pos) <= gl_state.b_property ? \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
214 ( update_syntax_table ((pos), -1, 0), 1 ) : \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
215 ( (pos) >= gl_state.e_property ? \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
216 ( update_syntax_table ((pos), 1, 0), 1 ) : 0))
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
217
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
218 /* This macro should be called with FROM at the start of forward
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
219 search, or after the last position of the backward search. It
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
220 makes sure that the first char is picked up with correct table, so
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
221 one does not need to call UPDATE_SYNTAX_TABLE immediately after the
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
222 call.
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
223 Sign of COUNT gives the direction of the search.
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
224 */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
225
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
226 #define SETUP_SYNTAX_TABLE(from,count) \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
227 gl_state.b_property = BEGV - 1; \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
228 gl_state.e_property = ZV + 1; \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
229 gl_state.use_global = 0; \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
230 gl_state.current_syntax_table = current_buffer->syntax_table; \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
231 if (parse_sexp_lookup_properties) \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
232 update_syntax_table ((count) > 0 ? (from) : (from) - 1, (count), 1, Qnil);
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
233
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
234 /* Same as above, but in OBJECT. If OBJECT is nil, use current buffer.
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
235 If it is t, ignore properties altogether. */
486
80cdb2387043 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
236
17465
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
237 #define SETUP_SYNTAX_TABLE_FOR_OBJECT(object, from, count) \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
238 if (BUFFERP (object)) \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
239 { \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
240 gl_state.b_property = BEGV - 1; \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
241 gl_state.e_property = ZV; \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
242 } \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
243 else if (EQ (object, Qt)) \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
244 { \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
245 gl_state.b_property = - 1; \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
246 gl_state.e_property = 1500000000; \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
247 } \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
248 else \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
249 { \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
250 gl_state.b_property = -1; \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
251 gl_state.e_property = 1 + XSTRING (object)->size; \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
252 } \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
253 gl_state.use_global = 0; \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
254 gl_state.current_syntax_table = current_buffer->syntax_table; \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
255 if (parse_sexp_lookup_properties) \
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
256 update_syntax_table (count > 0 ? (from) : (from) - 1, count, 1, object);
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
257
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
258 struct gl_state_s
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
259 {
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
260 int start; /* Where to stop. */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
261 int stop; /* Where to stop. */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
262 int use_global; /* Whether to use global_code
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
263 or c_s_t. */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
264 Lisp_Object global_code; /* Syntax code of current char. */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
265 Lisp_Object current_syntax_table; /* Syntax table for current pos. */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
266 Lisp_Object old_prop; /* Syntax-table prop at prev pos. */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
267 int b_property; /* Last index where c_s_t is
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
268 not valid. */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
269 int e_property; /* First index where c_s_t is
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
270 not valid. */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
271 INTERVAL forward_i; /* Where to start lookup on forward */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
272 INTERVAL backward_i; /* or backward movement. The
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
273 data in c_s_t is valid
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
274 between these intervals,
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
275 and possibly at the
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
276 intervals too, depending
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
277 on: */
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
278 char left_ok;
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
279 char right_ok;
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
280 };
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
281
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
282 extern struct gl_state_s gl_state;
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
283 extern int parse_sexp_lookup_properties;
8a008f65c8d4 (enum syntaxcode): New members Scomment_fence, Sstring_fence.
Richard M. Stallman <rms@gnu.org>
parents: 17181
diff changeset
284 extern INTERVAL interval_of();