Mercurial > hg > xemacs-beta
changeset 4912:e99033b7e05c
use more specific `scan-error' in scan-lists to be GNU compatible
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-02-01 Ben Wing <ben@xemacs.org>
* syntax.c:
* syntax.c (scan_lists):
* syntax.c (syms_of_syntax):
Declare `scan-error' as a type of `syntax-error'. In `scan-lists'
et al., don't signal a syntax error but instead a `scan-error', and
pass a couple of integer arguments, for GNU compatibility. Fixes
problems with typing double-quote in texinfo.el.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Mon, 01 Feb 2010 23:07:33 -0600 |
parents | 9e7f5a77cc84 |
children | fc28cc192c91 |
files | src/ChangeLog src/syntax.c |
diffstat | 2 files changed, 25 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Mon Feb 01 01:05:28 2010 -0600 +++ b/src/ChangeLog Mon Feb 01 23:07:33 2010 -0600 @@ -117,6 +117,16 @@ * keymap.c (keymap_hash): Implement. +2010-02-01 Ben Wing <ben@xemacs.org> + + * syntax.c: + * syntax.c (scan_lists): + * syntax.c (syms_of_syntax): + Declare `scan-error' as a type of `syntax-error'. In `scan-lists' + et al., don't signal a syntax error but instead a `scan-error', and + pass a couple of integer arguments, for GNU compatibility. Fixes + problems with typing double-quote in texinfo.el. + 2010-01-31 Aidan Kehoe <kehoea@parhasard.net> * symbols.c (Fspecial_operator_p, syms_of_symbols):
--- a/src/syntax.c Mon Feb 01 01:05:28 2010 -0600 +++ b/src/syntax.c Mon Feb 01 23:07:33 2010 -0600 @@ -69,6 +69,8 @@ /* A value that is guaranteed not be in a syntax table. */ Lisp_Object Vbogus_syntax_table_value; +Lisp_Object Qscan_error; + static void syntax_cache_table_was_changed (struct buffer *buf); /* This is the internal form of the parse state used in parse-partial-sexp. */ @@ -1353,6 +1355,7 @@ int syncode; int min_depth = depth; /* Err out if depth gets less than this. */ struct syntax_cache *scache; + Charbpos last_good = from; if (depth > 0) min_depth = 0; @@ -1370,6 +1373,8 @@ c = BUF_FETCH_CHAR (buf, from); syncode = SYNTAX_CODE_FROM_CACHE (scache, c); code = SYNTAX_FROM_CODE (syncode); + if (depth == min_depth) + last_good = from; from++; /* a 1-char comment start sequence */ @@ -1483,8 +1488,9 @@ { if (noerror) return Qnil; - syntax_error ("Containing expression ends prematurely", - Qunbound); + signal_error_2 (Qscan_error, + "Containing expression ends prematurely", + make_int (last_good), make_int (from)); } break; @@ -1656,8 +1662,9 @@ { if (noerror) return Qnil; - syntax_error ("Containing expression ends prematurely", - Qunbound); + signal_error_2 (Qscan_error, + "Containing expression ends prematurely", + make_int (last_good), make_int (from)); } break; @@ -1727,7 +1734,8 @@ lose: if (!noerror) - syntax_error ("Unbalanced parentheses", Qunbound); + signal_error_2 (Qscan_error, "Unbalanced parentheses", + make_int (last_good), make_int (from)); return Qnil; } @@ -2418,6 +2426,8 @@ DEFSUBR (Fscan_sexps); DEFSUBR (Fbackward_prefix_chars); DEFSUBR (Fparse_partial_sexp); + + DEFERROR_STANDARD (Qscan_error, Qsyntax_error); } void