aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorJoakim Verona2011-02-05 11:23:09 +0100
committerJoakim Verona2011-02-05 11:23:09 +0100
commit4bd51ad5c3445b644dfb017d5b57b10a90aa325f (patch)
tree894801e7308ce4ecc34933f959e28f4b9cff9533 /src/syntax.c
parent13cfe8df462ab8da9f0028e16cc84dcaceaca3d1 (diff)
parent9bcaafce5351d270ac514e23cb69ff1a5fd35229 (diff)
downloademacs-4bd51ad5c3445b644dfb017d5b57b10a90aa325f.tar.gz
emacs-4bd51ad5c3445b644dfb017d5b57b10a90aa325f.zip
merge from upstream. currently seems to have bitroted and i get segfaults
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c51
1 files changed, 8 insertions, 43 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 2f4f5236a40..2f47d73d695 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1,6 +1,5 @@
1/* GNU Emacs routines to deal with syntax tables; also word and list parsing. 1/* GNU Emacs routines to deal with syntax tables; also word and list parsing.
2 Copyright (C) 1985, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2001, 2 Copyright (C) 1985, 1987, 1993-1995, 1997-1999, 2001-2011
3 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
4 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
5 4
6This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -98,23 +97,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
98 97
99Lisp_Object Qsyntax_table_p, Qsyntax_table, Qscan_error; 98Lisp_Object Qsyntax_table_p, Qsyntax_table, Qscan_error;
100 99
101int words_include_escapes;
102int parse_sexp_lookup_properties;
103
104/* Nonzero means `scan-sexps' treat all multibyte characters as symbol. */
105int multibyte_syntax_as_symbol;
106
107/* Used as a temporary in SYNTAX_ENTRY and other macros in syntax.h, 100/* Used as a temporary in SYNTAX_ENTRY and other macros in syntax.h,
108 if not compiled with GCC. No need to mark it, since it is used 101 if not compiled with GCC. No need to mark it, since it is used
109 only very temporarily. */ 102 only very temporarily. */
110Lisp_Object syntax_temp; 103Lisp_Object syntax_temp;
111 104
112/* Non-zero means an open parenthesis in column 0 is always considered
113 to be the start of a defun. Zero means an open parenthesis in
114 column 0 has no special meaning. */
115
116int open_paren_in_column_0_is_defun_start;
117
118/* This is the internal form of the parse state used in parse-partial-sexp. */ 105/* This is the internal form of the parse state used in parse-partial-sexp. */
119 106
120struct lisp_parse_state 107struct lisp_parse_state
@@ -167,7 +154,6 @@ int syntax_prefix_flag_p (int c)
167 154
168struct gl_state_s gl_state; /* Global state of syntax parser. */ 155struct gl_state_s gl_state; /* Global state of syntax parser. */
169 156
170INTERVAL interval_of (int, Lisp_Object);
171#define INTERVALS_AT_ONCE 10 /* 1 + max-number of intervals 157#define INTERVALS_AT_ONCE 10 /* 1 + max-number of intervals
172 to scan to property-change. */ 158 to scan to property-change. */
173 159
@@ -371,23 +357,10 @@ char_quoted (EMACS_INT charpos, EMACS_INT bytepos)
371 return quoted; 357 return quoted;
372} 358}
373 359
374/* Return the bytepos one character after BYTEPOS.
375 We assume that BYTEPOS is not at the end of the buffer. */
376
377INLINE EMACS_INT
378inc_bytepos (EMACS_INT bytepos)
379{
380 if (NILP (current_buffer->enable_multibyte_characters))
381 return bytepos + 1;
382
383 INC_POS (bytepos);
384 return bytepos;
385}
386
387/* Return the bytepos one character before BYTEPOS. 360/* Return the bytepos one character before BYTEPOS.
388 We assume that BYTEPOS is not at the start of the buffer. */ 361 We assume that BYTEPOS is not at the start of the buffer. */
389 362
390INLINE EMACS_INT 363static INLINE EMACS_INT
391dec_bytepos (EMACS_INT bytepos) 364dec_bytepos (EMACS_INT bytepos)
392{ 365{
393 if (NILP (current_buffer->enable_multibyte_characters)) 366 if (NILP (current_buffer->enable_multibyte_characters))
@@ -1234,12 +1207,6 @@ DEFUN ("internal-describe-syntax-value", Finternal_describe_syntax_value,
1234 return syntax; 1207 return syntax;
1235} 1208}
1236 1209
1237int parse_sexp_ignore_comments;
1238
1239/* Char-table of functions that find the next or previous word
1240 boundary. */
1241Lisp_Object Vfind_word_boundary_function_table;
1242
1243/* Return the position across COUNT words from FROM. 1210/* Return the position across COUNT words from FROM.
1244 If that many words cannot be found before the end of the buffer, return 0. 1211 If that many words cannot be found before the end of the buffer, return 0.
1245 COUNT negative means scan backward and stop at word beginning. */ 1212 COUNT negative means scan backward and stop at word beginning. */
@@ -3496,31 +3463,31 @@ syms_of_syntax (void)
3496 Fput (Qscan_error, Qerror_message, 3463 Fput (Qscan_error, Qerror_message,
3497 make_pure_c_string ("Scan error")); 3464 make_pure_c_string ("Scan error"));
3498 3465
3499 DEFVAR_BOOL ("parse-sexp-ignore-comments", &parse_sexp_ignore_comments, 3466 DEFVAR_BOOL ("parse-sexp-ignore-comments", parse_sexp_ignore_comments,
3500 doc: /* Non-nil means `forward-sexp', etc., should treat comments as whitespace. */); 3467 doc: /* Non-nil means `forward-sexp', etc., should treat comments as whitespace. */);
3501 3468
3502 DEFVAR_BOOL ("parse-sexp-lookup-properties", &parse_sexp_lookup_properties, 3469 DEFVAR_BOOL ("parse-sexp-lookup-properties", parse_sexp_lookup_properties,
3503 doc: /* Non-nil means `forward-sexp', etc., obey `syntax-table' property. 3470 doc: /* Non-nil means `forward-sexp', etc., obey `syntax-table' property.
3504Otherwise, that text property is simply ignored. 3471Otherwise, that text property is simply ignored.
3505See the info node `(elisp)Syntax Properties' for a description of the 3472See the info node `(elisp)Syntax Properties' for a description of the
3506`syntax-table' property. */); 3473`syntax-table' property. */);
3507 3474
3508 words_include_escapes = 0; 3475 words_include_escapes = 0;
3509 DEFVAR_BOOL ("words-include-escapes", &words_include_escapes, 3476 DEFVAR_BOOL ("words-include-escapes", words_include_escapes,
3510 doc: /* Non-nil means `forward-word', etc., should treat escape chars part of words. */); 3477 doc: /* Non-nil means `forward-word', etc., should treat escape chars part of words. */);
3511 3478
3512 DEFVAR_BOOL ("multibyte-syntax-as-symbol", &multibyte_syntax_as_symbol, 3479 DEFVAR_BOOL ("multibyte-syntax-as-symbol", multibyte_syntax_as_symbol,
3513 doc: /* Non-nil means `scan-sexps' treats all multibyte characters as symbol. */); 3480 doc: /* Non-nil means `scan-sexps' treats all multibyte characters as symbol. */);
3514 multibyte_syntax_as_symbol = 0; 3481 multibyte_syntax_as_symbol = 0;
3515 3482
3516 DEFVAR_BOOL ("open-paren-in-column-0-is-defun-start", 3483 DEFVAR_BOOL ("open-paren-in-column-0-is-defun-start",
3517 &open_paren_in_column_0_is_defun_start, 3484 open_paren_in_column_0_is_defun_start,
3518 doc: /* *Non-nil means an open paren in column 0 denotes the start of a defun. */); 3485 doc: /* *Non-nil means an open paren in column 0 denotes the start of a defun. */);
3519 open_paren_in_column_0_is_defun_start = 1; 3486 open_paren_in_column_0_is_defun_start = 1;
3520 3487
3521 3488
3522 DEFVAR_LISP ("find-word-boundary-function-table", 3489 DEFVAR_LISP ("find-word-boundary-function-table",
3523 &Vfind_word_boundary_function_table, 3490 Vfind_word_boundary_function_table,
3524 doc: /* 3491 doc: /*
3525Char table of functions to search for the word boundary. 3492Char table of functions to search for the word boundary.
3526Each function is called with two arguments; POS and LIMIT. 3493Each function is called with two arguments; POS and LIMIT.
@@ -3562,5 +3529,3 @@ In both cases, LIMIT bounds the search. */);
3562 defsubr (&Sparse_partial_sexp); 3529 defsubr (&Sparse_partial_sexp);
3563} 3530}
3564 3531
3565/* arch-tag: 3e297b9f-088e-4b64-8f4c-fb0b3443e412
3566 (do not change this comment) */