diff options
| author | Richard M. Stallman | 1998-03-02 06:01:09 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-03-02 06:01:09 +0000 |
| commit | 2f16e7fdda43ca0a87aea694d181878078b6b8c3 (patch) | |
| tree | f3065d1a90f3f45568868e1fd11e670358bb400c /src | |
| parent | 02f853b5e31f93a121683f2c4056769bdac07a6f (diff) | |
| download | emacs-2f16e7fdda43ca0a87aea694d181878078b6b8c3.tar.gz emacs-2f16e7fdda43ca0a87aea694d181878078b6b8c3.zip | |
(UPDATE_SYNTAX_TABLE): Do nothing unless parse_sexp_lookup_properties.
(UPDATE_SYNTAX_TABLE_FORWARD, UPDATE_SYNTAX_TABLE_BACKWARD): Likewise.
(SYNTAX_TABLE_BYTE_TO_CHAR): If parse_sexp_lookup_properties is 0,
return 0 right away.
(SETUP_SYNTAX_TABLE): Add if (1) ... else.
Diffstat (limited to 'src')
| -rw-r--r-- | src/syntax.h | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/src/syntax.h b/src/syntax.h index ac4b84db04b..dcca2110ce1 100644 --- a/src/syntax.h +++ b/src/syntax.h | |||
| @@ -195,10 +195,16 @@ extern unsigned char syntax_spec_code[0400]; | |||
| 195 | extern char syntax_code_spec[16]; | 195 | extern char syntax_code_spec[16]; |
| 196 | 196 | ||
| 197 | /* Convert the byte offset BYTEPOS into a character position, | 197 | /* Convert the byte offset BYTEPOS into a character position, |
| 198 | for the object recorded in gl_state with SETUP_SYNTAX_TABLE_FOR_OBJECT. */ | 198 | for the object recorded in gl_state with SETUP_SYNTAX_TABLE_FOR_OBJECT. |
| 199 | |||
| 200 | The value is meant for use in the UPDATE_SYNTAX_TABLE... macros. | ||
| 201 | These macros do nothing when parse_sexp_lookup_properties is 0, | ||
| 202 | so we return 0 in that case, for speed. */ | ||
| 199 | 203 | ||
| 200 | #define SYNTAX_TABLE_BYTE_TO_CHAR(bytepos) \ | 204 | #define SYNTAX_TABLE_BYTE_TO_CHAR(bytepos) \ |
| 201 | (STRINGP (gl_state.object) \ | 205 | (! parse_sexp_lookup_properties \ |
| 206 | ? 0 \ | ||
| 207 | : STRINGP (gl_state.object) \ | ||
| 202 | ? string_byte_to_char (gl_state.object, (bytepos)) \ | 208 | ? string_byte_to_char (gl_state.object, (bytepos)) \ |
| 203 | : BUFFERP (gl_state.object) \ | 209 | : BUFFERP (gl_state.object) \ |
| 204 | ? buf_bytepos_to_charpos (XBUFFER (gl_state.object), (bytepos)) \ | 210 | ? buf_bytepos_to_charpos (XBUFFER (gl_state.object), (bytepos)) \ |
| @@ -210,7 +216,8 @@ extern char syntax_code_spec[16]; | |||
| 210 | currently good for a position before POS. */ | 216 | currently good for a position before POS. */ |
| 211 | 217 | ||
| 212 | #define UPDATE_SYNTAX_TABLE_FORWARD(pos) \ | 218 | #define UPDATE_SYNTAX_TABLE_FORWARD(pos) \ |
| 213 | ((pos) >= gl_state.e_property \ | 219 | (parse_sexp_lookup_properties \ |
| 220 | && (pos) >= gl_state.e_property \ | ||
| 214 | ? (update_syntax_table ((pos) + gl_state.offset, 1, 0, \ | 221 | ? (update_syntax_table ((pos) + gl_state.offset, 1, 0, \ |
| 215 | gl_state.object), \ | 222 | gl_state.object), \ |
| 216 | 1) \ | 223 | 1) \ |
| @@ -220,7 +227,8 @@ extern char syntax_code_spec[16]; | |||
| 220 | currently good for a position after POS. */ | 227 | currently good for a position after POS. */ |
| 221 | 228 | ||
| 222 | #define UPDATE_SYNTAX_TABLE_BACKWARD(pos) \ | 229 | #define UPDATE_SYNTAX_TABLE_BACKWARD(pos) \ |
| 223 | ((pos) <= gl_state.b_property \ | 230 | (parse_sexp_lookup_properties \ |
| 231 | && (pos) <= gl_state.b_property \ | ||
| 224 | ? (update_syntax_table ((pos) + gl_state.offset, -1, 0, \ | 232 | ? (update_syntax_table ((pos) + gl_state.offset, -1, 0, \ |
| 225 | gl_state.object), \ | 233 | gl_state.object), \ |
| 226 | 1) \ | 234 | 1) \ |
| @@ -229,11 +237,13 @@ extern char syntax_code_spec[16]; | |||
| 229 | /* Make syntax table good for POS. */ | 237 | /* Make syntax table good for POS. */ |
| 230 | 238 | ||
| 231 | #define UPDATE_SYNTAX_TABLE(pos) \ | 239 | #define UPDATE_SYNTAX_TABLE(pos) \ |
| 232 | ((pos) <= gl_state.b_property \ | 240 | (parse_sexp_lookup_properties \ |
| 241 | && (pos) <= gl_state.b_property \ | ||
| 233 | ? (update_syntax_table ((pos) + gl_state.offset, -1, 0, \ | 242 | ? (update_syntax_table ((pos) + gl_state.offset, -1, 0, \ |
| 234 | gl_state.object), \ | 243 | gl_state.object), \ |
| 235 | 1) \ | 244 | 1) \ |
| 236 | : ((pos) >= gl_state.e_property \ | 245 | : (parse_sexp_lookup_properties \ |
| 246 | && (pos) >= gl_state.e_property \ | ||
| 237 | ? (update_syntax_table ((pos) + gl_state.offset, 1, 0, \ | 247 | ? (update_syntax_table ((pos) + gl_state.offset, 1, 0, \ |
| 238 | gl_state.object), \ | 248 | gl_state.object), \ |
| 239 | 1) \ | 249 | 1) \ |
| @@ -248,15 +258,19 @@ extern char syntax_code_spec[16]; | |||
| 248 | */ | 258 | */ |
| 249 | 259 | ||
| 250 | #define SETUP_SYNTAX_TABLE(FROM, COUNT) \ | 260 | #define SETUP_SYNTAX_TABLE(FROM, COUNT) \ |
| 251 | gl_state.b_property = BEGV - 1; \ | 261 | if (1) \ |
| 252 | gl_state.e_property = ZV + 1; \ | 262 | { \ |
| 253 | gl_state.object = Qnil; \ | 263 | gl_state.b_property = BEGV - 1; \ |
| 254 | gl_state.use_global = 0; \ | 264 | gl_state.e_property = ZV + 1; \ |
| 255 | gl_state.offset = 0; \ | 265 | gl_state.object = Qnil; \ |
| 256 | gl_state.current_syntax_table = current_buffer->syntax_table; \ | 266 | gl_state.use_global = 0; \ |
| 257 | if (parse_sexp_lookup_properties) \ | 267 | gl_state.offset = 0; \ |
| 258 | update_syntax_table ((COUNT) > 0 ? (FROM) : (FROM) - 1, (COUNT), \ | 268 | gl_state.current_syntax_table = current_buffer->syntax_table; \ |
| 259 | 1, Qnil); | 269 | if (parse_sexp_lookup_properties) \ |
| 270 | update_syntax_table ((COUNT) > 0 ? (FROM) : (FROM) - 1, (COUNT), \ | ||
| 271 | 1, Qnil); \ | ||
| 272 | } \ | ||
| 273 | else | ||
| 260 | 274 | ||
| 261 | /* Same as above, but in OBJECT. If OBJECT is nil, use current buffer. | 275 | /* Same as above, but in OBJECT. If OBJECT is nil, use current buffer. |
| 262 | If it is t, ignore properties altogether. | 276 | If it is t, ignore properties altogether. |