Now on revision 114001. ------------------------------------------------------------ revno: 114001 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2013-08-26 09:32:47 +0400 message: Fix recovering from possible decompression error. Since insert_from_gap doesn't always move point, we can't use PT as the position where the partially decompressed data ends, and should count how may bytes was produced so far. * decompress.c (struct decompress_unwind_data): Add nbytes member. (unwind_decompress): Really delete partially uncompressed data. (Fzlib_decompress_region): Take decompressed data size into account. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-08-26 05:20:59 +0000 +++ src/ChangeLog 2013-08-26 05:32:47 +0000 @@ -1,5 +1,15 @@ 2013-08-26 Dmitry Antipov + Fix recovering from possible decompression error. Since + insert_from_gap doesn't always move point, we can't use PT as + the position where the partially decompressed data ends, and + should count how may bytes was produced so far. + * decompress.c (struct decompress_unwind_data): Add nbytes member. + (unwind_decompress): Really delete partially uncompressed data. + (Fzlib_decompress_region): Take decompressed data size into account. + +2013-08-26 Dmitry Antipov + * syntax.c (init_syntax_once): Adjust comment and do an early initialization of Qchar_table_extra_slots just once... * casetab.c (init_casetab_once): === modified file 'src/decompress.c' --- src/decompress.c 2013-08-17 17:18:07 +0000 +++ src/decompress.c 2013-08-26 05:32:47 +0000 @@ -85,7 +85,7 @@ struct decompress_unwind_data { - ptrdiff_t old_point, start; + ptrdiff_t old_point, start, nbytes; z_stream *stream; }; @@ -97,7 +97,7 @@ /* Delete any uncompressed data already inserted on error. */ if (data->start) - del_range (data->start, PT); + del_range (data->start, data->start + data->nbytes); /* Put point where it was, or if the buffer has shrunk because the compressed data is bigger than the uncompressed, at @@ -173,7 +173,7 @@ unwind_data.start = iend; unwind_data.stream = &stream; unwind_data.old_point = PT; - + unwind_data.nbytes = 0; record_unwind_protect_ptr (unwind_decompress, &unwind_data); /* Insert the decompressed data at the end of the compressed data. */ @@ -201,6 +201,7 @@ pos_byte += avail_in - stream.avail_in; decompressed = avail_out - stream.avail_out; insert_from_gap (decompressed, decompressed, 0); + unwind_data.nbytes += decompressed; QUIT; } while (inflate_status == Z_OK); ------------------------------------------------------------ revno: 114000 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2013-08-26 09:26:06 +0400 message: * alloc.c (sweep_vectors): Do not initialize 'block' twice. diff: === modified file 'src/alloc.c' --- src/alloc.c 2013-08-21 07:02:45 +0000 +++ src/alloc.c 2013-08-26 05:26:06 +0000 @@ -2805,7 +2805,7 @@ static void sweep_vectors (void) { - struct vector_block *block = vector_blocks, **bprev = &vector_blocks; + struct vector_block *block, **bprev = &vector_blocks; struct large_vector *lv, **lvprev = &large_vectors; struct Lisp_Vector *vector, *next; ------------------------------------------------------------ revno: 113999 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2013-08-26 09:20:59 +0400 message: * syntax.c (init_syntax_once): Adjust comment and do an early initialization of Qchar_table_extra_slots just once... * casetab.c (init_casetab_once): * category.c (init_category_once): * character.c (syms_of_character): * coding.c (syms_of_coding): * xdisp.c (syms_of_xdisp): ...and omit it here. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-08-24 12:59:13 +0000 +++ src/ChangeLog 2013-08-26 05:20:59 +0000 @@ -1,3 +1,13 @@ +2013-08-26 Dmitry Antipov + + * syntax.c (init_syntax_once): Adjust comment and do an early + initialization of Qchar_table_extra_slots just once... + * casetab.c (init_casetab_once): + * category.c (init_category_once): + * character.c (syms_of_character): + * coding.c (syms_of_coding): + * xdisp.c (syms_of_xdisp): ...and omit it here. + 2013-08-24 Eli Zaretskii * xdisp.c (get_next_display_element): Don't apply to characters === modified file 'src/casetab.c' --- src/casetab.c 2013-05-22 21:35:00 +0000 +++ src/casetab.c 2013-08-26 05:20:59 +0000 @@ -247,15 +247,8 @@ { register int i; Lisp_Object down, up, eqv; + DEFSYM (Qcase_table, "case-table"); - - /* Intern this now in case it isn't already done. - Setting this variable twice is harmless. - But don't staticpro it here--that is done in alloc.c. */ - Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots"); - - /* Now we are ready to set up this property, so we can - create char tables. */ Fput (Qcase_table, Qchar_table_extra_slots, make_number (3)); down = Fmake_char_table (Qcase_table, Qnil); === modified file 'src/category.c' --- src/category.c 2013-01-02 16:13:04 +0000 +++ src/category.c 2013-08-26 05:20:59 +0000 @@ -460,14 +460,6 @@ { /* This has to be done here, before we call Fmake_char_table. */ DEFSYM (Qcategory_table, "category-table"); - - /* Intern this now in case it isn't already done. - Setting this variable twice is harmless. - But don't staticpro it here--that is done in alloc.c. */ - Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots"); - - /* Now we are ready to set up this property, so we can - create category tables. */ Fput (Qcategory_table, Qchar_table_extra_slots, make_number (2)); Vstandard_category_table = Fmake_char_table (Qcategory_table, Qnil); === modified file 'src/character.c' --- src/character.c 2013-08-20 14:56:03 +0000 +++ src/character.c 2013-08-26 05:20:59 +0000 @@ -1072,10 +1072,6 @@ doc: /* Char table of script symbols. It has one extra slot whose value is a list of script symbols. */); - /* Intern this now in case it isn't already done. - Setting this variable twice is harmless. - But don't staticpro it here--that is done in alloc.c. */ - Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots"); DEFSYM (Qchar_script_table, "char-script-table"); Fput (Qchar_script_table, Qchar_table_extra_slots, make_number (1)); Vchar_script_table = Fmake_char_table (Qchar_script_table, Qnil); === modified file 'src/coding.c' --- src/coding.c 2013-08-03 18:16:43 +0000 +++ src/coding.c 2013-08-26 05:20:59 +0000 @@ -10814,11 +10814,6 @@ Fput (Qcoding_system_error, Qerror_message, build_pure_c_string ("Invalid coding system")); - /* Intern this now in case it isn't already done. - Setting this variable twice is harmless. - But don't staticpro it here--that is done in alloc.c. */ - Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots"); - DEFSYM (Qtranslation_table, "translation-table"); Fput (Qtranslation_table, Qchar_table_extra_slots, make_number (2)); DEFSYM (Qtranslation_table_id, "translation-table-id"); === modified file 'src/syntax.c' --- src/syntax.c 2013-08-13 14:26:39 +0000 +++ src/syntax.c 2013-08-26 05:20:59 +0000 @@ -3486,9 +3486,9 @@ /* This has to be done here, before we call Fmake_char_table. */ DEFSYM (Qsyntax_table, "syntax-table"); - /* Intern_C_String this now in case it isn't already done. - Setting this variable twice is harmless. - But don't staticpro it here--that is done in alloc.c. */ + /* This variable is DEFSYMed in alloc.c and not initialized yet, so + intern it here. NOTE: you must guarantee that init_syntax_once + is called before all other users of this variable. */ Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots"); /* Create objects which can be shared among syntax tables. */ === modified file 'src/xdisp.c' --- src/xdisp.c 2013-08-24 15:21:05 +0000 +++ src/xdisp.c 2013-08-26 05:20:59 +0000 @@ -29731,10 +29731,6 @@ DEFSYM (Qzero_width, "zero-width"); DEFSYM (Qglyphless_char_display, "glyphless-char-display"); - /* Intern this now in case it isn't already done. - Setting this variable twice is harmless. - But don't staticpro it here--that is done in alloc.c. */ - Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots"); Fput (Qglyphless_char_display, Qchar_table_extra_slots, make_number (1)); DEFVAR_LISP ("glyphless-char-display", Vglyphless_char_display, ------------------------------------------------------------ revno: 113998 committer: Xue Fuqiao branch nick: trunk timestamp: Mon 2013-08-26 06:30:56 +0800 message: Fix broken customization in Flymake. * lisp/progmodes/flymake.el (flymake-get-real-file-name-function): Fix broken customization. (Bug#15184) diff: === modified file 'doc/lispref/nonascii.texi' --- doc/lispref/nonascii.texi 2013-08-02 13:52:10 +0000 +++ doc/lispref/nonascii.texi 2013-08-25 22:30:56 +0000 @@ -248,6 +248,7 @@ characters. @end defun +@c FIXME: Should `@var{character}' be `@var{byte}'? @defun byte-to-string byte @cindex byte to string This function returns a unibyte string containing a single byte of @@ -401,6 +402,8 @@ during text processing and display. Thus, character properties are an important part of specifying the character's semantics. +@c FIXME: Use the latest URI of this chapter? +@c http://www.unicode.org/versions/latest/ch04.pdf On the whole, Emacs follows the Unicode Standard in its implementation of character properties. In particular, Emacs supports the @uref{http://www.unicode.org/reports/tr23/, Unicode Character Property === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-08-25 21:06:07 +0000 +++ lisp/ChangeLog 2013-08-25 22:30:56 +0000 @@ -1,3 +1,8 @@ +2013-08-25 Xue Fuqiao + + * progmodes/flymake.el (flymake-get-real-file-name-function): + Fix broken customization. (Bug#15184) + 2013-08-25 Alan Mackenzie Improve indentation of bracelists defined by macros (without "="). === modified file 'lisp/progmodes/flymake.el' --- lisp/progmodes/flymake.el 2013-06-21 14:36:13 +0000 +++ lisp/progmodes/flymake.el 2013-08-25 22:30:56 +0000 @@ -353,7 +353,7 @@ 'flymake-simple-cleanup)) (defun flymake-get-real-file-name-function (file-name) - (or (nth 4 (flymake-get-file-name-mode-and-masks file-name)) + (or (nth 2 (flymake-get-file-name-mode-and-masks file-name)) 'flymake-get-real-file-name)) (defvar flymake-find-buildfile-cache (flymake-makehash 'equal)) ------------------------------------------------------------ revno: 113997 committer: Alan Mackenzie branch nick: trunk timestamp: Sun 2013-08-25 21:06:07 +0000 message: Improve indentation of bracelists defined by macros (without "="). * progmodes/cc-engine.el (c-inside-bracelist-p): When a macro expansion begins with "{", regard it as bracelist when it doesn't contain a ";". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-08-25 13:52:14 +0000 +++ lisp/ChangeLog 2013-08-25 21:06:07 +0000 @@ -1,5 +1,11 @@ 2013-08-25 Alan Mackenzie + Improve indentation of bracelists defined by macros (without "="). + + * progmodes/cc-engine.el (c-inside-bracelist-p): When a macro + expansion begins with "{", regard it as bracelist when it doesn't + contain a ";". + Parse C++ inher-intro when there's a template split over 2 lines. * progmodes/cc-engine.el (c-guess-basic-syntax CASE 5C): Code more === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2013-08-25 13:52:14 +0000 +++ lisp/progmodes/cc-engine.el 2013-08-25 21:06:07 +0000 @@ -8476,10 +8476,10 @@ ;; check for the class key here. (and (c-major-mode-is 'pike-mode) c-decl-block-key)) - bufpos braceassignp lim next-containing) + bufpos braceassignp lim next-containing macro-start) (while (and (not bufpos) containing-sexp) - (when paren-state + (when paren-state (if (consp (car paren-state)) (setq lim (cdr (car paren-state)) paren-state (cdr paren-state)) @@ -8560,22 +8560,38 @@ )))) nil) (t t)))))) - (if (and (eq braceassignp 'dontknow) - (/= (c-backward-token-2 1 t lim) 0)) - (setq braceassignp nil))) - (if (not braceassignp) - (if (eq (char-after) ?\;) - ;; Brace lists can't contain a semicolon, so we're done. - (setq containing-sexp nil) - ;; Go up one level. - (setq containing-sexp next-containing - lim nil - next-containing nil)) - ;; we've hit the beginning of the aggregate list - (c-beginning-of-statement-1 - (c-most-enclosing-brace paren-state)) - (setq bufpos (point)))) - ) + (if (and (eq braceassignp 'dontknow) + (/= (c-backward-token-2 1 t lim) 0)) + (setq braceassignp nil))) + (cond + (braceassignp + ;; We've hit the beginning of the aggregate list. + (c-beginning-of-statement-1 + (c-most-enclosing-brace paren-state)) + (setq bufpos (point))) + ((eq (char-after) ?\;) + ;; Brace lists can't contain a semicolon, so we're done. + (setq containing-sexp nil)) + ((and (setq macro-start (point)) + (c-forward-to-cpp-define-body) + (eq (point) containing-sexp)) + ;; We've a macro whose expansion starts with the '{'. + ;; Heuristically, if we have a ';' in it we've not got a + ;; brace list, otherwise we have. + (let ((macro-end (progn (c-end-of-macro) (point)))) + (goto-char containing-sexp) + (forward-char) + (if (and (c-syntactic-re-search-forward "[;,]" macro-end t t) + (eq (char-before) ?\;)) + (setq bufpos nil + containing-sexp nil) + (setq bufpos macro-start)))) + (t + ;; Go up one level + (setq containing-sexp next-containing + lim nil + next-containing nil))))) + bufpos)) )) ------------------------------------------------------------ revno: 113996 committer: Vincent Belaïche branch nick: trunk timestamp: Sun 2013-08-25 22:11:56 +0200 message: Add a question into configure.bat whether the user want to continue at his/her own risks. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2013-08-25 19:46:41 +0000 +++ nt/ChangeLog 2013-08-25 20:11:56 +0000 @@ -1,3 +1,9 @@ +2013-08-25 Vincent Belaïche + + * configure.bat: Rather than disabling, make configure.bat produce + some warning that building with configure.bat is deprecated and + ask for confirmation to continue. + 2013-08-25 Glenn Morris * INSTALL: Refer to INSTALL.MSYS. === modified file 'nt/configure.bat' --- nt/configure.bat 2013-08-25 19:44:59 +0000 +++ nt/configure.bat 2013-08-25 20:11:56 +0000 @@ -58,10 +58,20 @@ rem [7] not recommended; please report if you try this combination. rem [8] tested only on Windows XP. rem -echo This method of building Emacs is no longer supported. -echo Instead, follow the instructions from INSTALL.MSYS. -goto end +echo **************************************************************** +echo *** THIS METHOD OF BUILDING EMACS IS NO LONGER SUPPORTED. ** +echo *** INSTEAD, FOLLOW THE INSTRUCTIONS FROM INSTALL.MSYS. ** +echo **************************************************************** +:confirm_continue +set /p answer=Continue running this script at your own risks ? (Y/N) +if x%answer% == xy (goto confirm_continue_y) +if x%answer% == xY (goto confirm_continue_y) +if x%answer% == xn (goto end) +if x%answer% == xN (goto end) +echo Please answer by Y or N +goto confirm_continue +:confirm_continue_y if exist config.log del config.log rem ---------------------------------------------------------------------- ------------------------------------------------------------ revno: 113995 committer: Glenn Morris branch nick: trunk timestamp: Sun 2013-08-25 12:46:41 -0700 message: * INSTALL: Refer to INSTALL.MSYS. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2013-08-25 19:44:59 +0000 +++ nt/ChangeLog 2013-08-25 19:46:41 +0000 @@ -1,5 +1,6 @@ 2013-08-25 Glenn Morris + * INSTALL: Refer to INSTALL.MSYS. * configure.bat: Disable it. 2013-08-04 Eli Zaretskii === modified file 'nt/INSTALL' --- nt/INSTALL 2013-04-17 16:37:57 +0000 +++ nt/INSTALL 2013-08-25 19:46:41 +0000 @@ -4,6 +4,9 @@ Copyright (C) 2001-2013 Free Software Foundation, Inc. See the end of the file for license conditions. +*** This method of building Emacs is no longer supported. *** + Instead, see INSTALL.MSYS. + * For the impatient Here are the concise instructions for configuring and building the ------------------------------------------------------------ revno: 113994 committer: Glenn Morris branch nick: trunk timestamp: Sun 2013-08-25 12:44:59 -0700 message: * nt/configure.bat: Disable it. Ref http://lists.gnu.org/archive/html/emacs-devel/2013-08/msg00705.html diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2013-08-04 15:43:10 +0000 +++ nt/ChangeLog 2013-08-25 19:44:59 +0000 @@ -1,7 +1,10 @@ +2013-08-25 Glenn Morris + + * configure.bat: Disable it. + 2013-08-04 Eli Zaretskii - * mingw-cfg.site (ac_cv_func_mkostemp): New var with value of - "yes". + * mingw-cfg.site (ac_cv_func_mkostemp): New var with value of "yes". * inc/ms-w32.h (mkostemp): Declare prototype. (mktemp): Don't redirect to sys_mktemp. === modified file 'nt/configure.bat' --- nt/configure.bat 2013-06-25 15:08:47 +0000 +++ nt/configure.bat 2013-08-25 19:44:59 +0000 @@ -58,6 +58,9 @@ rem [7] not recommended; please report if you try this combination. rem [8] tested only on Windows XP. rem +echo This method of building Emacs is no longer supported. +echo Instead, follow the instructions from INSTALL.MSYS. +goto end if exist config.log del config.log ------------------------------------------------------------ revno: 113993 committer: Alan Mackenzie branch nick: trunk timestamp: Sun 2013-08-25 13:52:14 +0000 message: Parse C++ inher-intro when there's a template split over 2 lines. * progmodes/cc-engine.el (c-guess-basic-syntax CASE 5C): Code more rigorously the search for "class" etc. followed by ":". * progmodes/cc-langs.el (c-opt-<>-sexp-key): Make the value for random languages a regexp which never matches rather than nil. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-08-25 10:09:56 +0000 +++ lisp/ChangeLog 2013-08-25 13:52:14 +0000 @@ -1,5 +1,13 @@ 2013-08-25 Alan Mackenzie + Parse C++ inher-intro when there's a template split over 2 lines. + + * progmodes/cc-engine.el (c-guess-basic-syntax CASE 5C): Code more + rigorously the search for "class" etc. followed by ":". + + * progmodes/cc-langs.el (c-opt-<>-sexp-key): Make the value for + random languages a regexp which never matches rather than nil. + Handle "/"s more accurately in test for virtual semicolons (AWK Mode). * progmodes/cc-awk.el (c-awk-one-line-possibly-open-string-re) === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2013-08-25 10:09:56 +0000 +++ lisp/progmodes/cc-engine.el 2013-08-25 13:52:14 +0000 @@ -9799,12 +9799,12 @@ (not (eq (char-after) ?:)) ))) (save-excursion - (c-backward-syntactic-ws lim) - (if (eq char-before-ip ?:) - (progn - (forward-char -1) - (c-backward-syntactic-ws lim))) - (back-to-indentation) + (c-beginning-of-statement-1 lim) + (when (looking-at c-opt-<>-sexp-key) + (goto-char (match-end 1)) + (c-forward-syntactic-ws) + (c-forward-<>-arglist nil) + (c-forward-syntactic-ws)) (looking-at c-class-key))) ;; for Java (and (c-major-mode-is 'java-mode) === modified file 'lisp/progmodes/cc-langs.el' --- lisp/progmodes/cc-langs.el 2013-07-27 17:35:04 +0000 +++ lisp/progmodes/cc-langs.el 2013-08-25 13:52:14 +0000 @@ -2163,8 +2163,7 @@ (c-lang-defconst c-opt-<>-sexp-key ;; Adorned regexp matching keywords that can be followed by an angle ;; bracket sexp. Always set when `c-recognize-<>-arglists' is. - t (if (c-lang-const c-recognize-<>-arglists) - (c-make-keywords-re t (c-lang-const c-<>-sexp-kwds)))) + t (c-make-keywords-re t (c-lang-const c-<>-sexp-kwds))) (c-lang-defvar c-opt-<>-sexp-key (c-lang-const c-opt-<>-sexp-key)) (c-lang-defconst c-brace-id-list-kwds ------------------------------------------------------------ revno: 113992 committer: Alan Mackenzie branch nick: trunk timestamp: Sun 2013-08-25 10:09:56 +0000 message: Handle "/"s more accurately in test for virtual semicolons (AWK Mode). * progmodes/cc-awk.el (c-awk-one-line-possibly-open-string-re) (c-awk-regexp-one-line-possibly-open-char-list-re) (c-awk-one-line-possibly-open-regexp-re) (c-awk-one-line-non-syn-ws*-re): Remove. (c-awk-possibly-open-string-re, c-awk-non-/-syn-ws*-re) (c-awk-space*-/-re, c-awk-space*-regexp-/-re) (c-awk-space*-unclosed-regexp-/-re): New constants. (c-awk-at-vsemi-p): Reformulate better to recognize "/"s which aren't regexp delimiters. * progmodes/cc-engine.el (c-crosses-statement-barrier-p): Add in handling for a rare situation in AWK Mode involving unterminated strings/regexps. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-08-23 18:58:41 +0000 +++ lisp/ChangeLog 2013-08-25 10:09:56 +0000 @@ -1,3 +1,21 @@ +2013-08-25 Alan Mackenzie + + Handle "/"s more accurately in test for virtual semicolons (AWK Mode). + + * progmodes/cc-awk.el (c-awk-one-line-possibly-open-string-re) + (c-awk-regexp-one-line-possibly-open-char-list-re) + (c-awk-one-line-possibly-open-regexp-re) + (c-awk-one-line-non-syn-ws*-re): Remove. + (c-awk-possibly-open-string-re, c-awk-non-/-syn-ws*-re) + (c-awk-space*-/-re, c-awk-space*-regexp-/-re) + (c-awk-space*-unclosed-regexp-/-re): New constants. + (c-awk-at-vsemi-p): Reformulate better to recognize "/"s which + aren't regexp delimiters. + + * progmodes/cc-engine.el (c-crosses-statement-barrier-p): Add in + handling for a rare situation in AWK Mode involving unterminated + strings/regexps. + 2013-08-23 Glenn Morris * files.el (auto-mode-alist): Use sh-mode for .bash_history. === modified file 'lisp/progmodes/cc-awk.el' --- lisp/progmodes/cc-awk.el 2013-02-02 06:04:06 +0000 +++ lisp/progmodes/cc-awk.el 2013-08-25 10:09:56 +0000 @@ -169,9 +169,9 @@ (concat "\\=_?\"" c-awk-string-innards-re)) ;; Matches an AWK string at point up to, but not including, any terminator. ;; A gawk 3.1+ string may look like _"localizable string". -(defconst c-awk-one-line-possibly-open-string-re - (concat "\"\\(" c-awk-string-ch-re "\\|" c-awk-non-eol-esc-pair-re "\\)*" - "\\(\"\\|\\\\?$\\|\\'\\)")) +(defconst c-awk-possibly-open-string-re + (concat "\"\\(" c-awk-string-ch-re "\\|" c-awk-esc-pair-re "\\)*" + "\\(\"\\|$\\|\\'\\)")) ;; REGEXPS FOR AWK REGEXPS. (defconst c-awk-regexp-normal-re "[^[/\\\n\r]") @@ -192,25 +192,13 @@ "\\|" "[^]\n\r]" "\\)*" "\\(]\\|$\\)")) ;; Matches a regexp char list, up to (but not including) EOL if the ] is ;; missing. -(defconst c-awk-regexp-one-line-possibly-open-char-list-re - (concat "\\[\\]?\\(" c-awk-non-eol-esc-pair-re "\\|" "[^]\n\r]" "\\)*" - "\\(]\\|\\\\?$\\|\\'\\)")) -;; Matches the head (or all) of a regexp char class, up to (but not -;; including) the first EOL. (defconst c-awk-regexp-innards-re (concat "\\(" c-awk-esc-pair-re "\\|" c-awk-regexp-char-list-re - "\\|" c-awk-regexp-normal-re "\\)*")) + "\\|" c-awk-regexp-normal-re "\\)*")) ;; Matches the inside of an AWK regexp (i.e. without the enclosing /s) (defconst c-awk-regexp-without-end-re (concat "/" c-awk-regexp-innards-re)) ;; Matches an AWK regexp up to, but not including, any terminating /. -(defconst c-awk-one-line-possibly-open-regexp-re - (concat "/\\(" c-awk-non-eol-esc-pair-re - "\\|" c-awk-regexp-one-line-possibly-open-char-list-re - "\\|" c-awk-regexp-normal-re "\\)*" - "\\(/\\|\\\\?$\\|\\'\\)")) -;; Matches as much of the head of an AWK regexp which fits on one line, -;; possibly all of it. ;; REGEXPS used for scanning an AWK buffer in order to decide IF A '/' IS A ;; REGEXP OPENER OR A DIVISION SIGN. By "state" in the following is meant @@ -262,15 +250,24 @@ ;; REGEXPS USED FOR FINDING THE POSITION OF A "virtual semicolon" (defconst c-awk-_-harmless-nonws-char-re "[^#/\"\\\\\n\r \t]") -;; NEW VERSION! (which will be restricted to the current line) -(defconst c-awk-one-line-non-syn-ws*-re - (concat "\\([ \t]*" - "\\(" c-awk-_-harmless-nonws-char-re "\\|" - c-awk-non-eol-esc-pair-re "\\|" - c-awk-one-line-possibly-open-string-re "\\|" - c-awk-one-line-possibly-open-regexp-re - "\\)" - "\\)*")) +(defconst c-awk-non-/-syn-ws*-re + (concat + "\\(" c-awk-escaped-nls*-with-space* + "\\(" c-awk-_-harmless-nonws-char-re "\\|" + c-awk-non-eol-esc-pair-re "\\|" + c-awk-possibly-open-string-re + "\\)" + "\\)*")) +(defconst c-awk-space*-/-re (concat c-awk-escaped-nls*-with-space* "/")) +;; Matches optional whitespace followed by "/". +(defconst c-awk-space*-regexp-/-re + (concat c-awk-escaped-nls*-with-space* "\\s\"")) +;; Matches optional whitespace followed by a "/" with string syntax (a matched +;; regexp delimiter). +(defconst c-awk-space*-unclosed-regexp-/-re + (concat c-awk-escaped-nls*-with-space* "\\s\|")) +;; Matches optional whitespace followed by a "/" with string fence syntax (an +;; unmatched regexp delimiter). ;; ACM, 2002/5/29: @@ -549,10 +546,36 @@ (defun c-awk-at-vsemi-p (&optional pos) ;; Is there a virtual semicolon at POS (or POINT)? (save-excursion - (let (nl-prop - (pos-or-point (progn (if pos (goto-char pos)) (point)))) - (forward-line 0) - (search-forward-regexp c-awk-one-line-non-syn-ws*-re) + (let* (nl-prop + (pos-or-point (progn (if pos (goto-char pos)) (point))) + (bol (c-point 'bol)) (eol (c-point 'eol))) + (c-awk-beginning-of-logical-line) + ;; Next `while' goes round one logical line (ending in, e.g. "\\") per + ;; iteration. Such a line is rare, and can only be an open string + ;; ending in an escaped \. + (while + (progn + ;; Next `while' goes over a division sign or /regexp/ per iteration. + (while + (and + (< (point) eol) + (progn + (search-forward-regexp c-awk-non-/-syn-ws*-re eol) + (looking-at c-awk-space*-/-re))) + (cond + ((looking-at c-awk-space*-regexp-/-re) ; /regexp/ + (forward-sexp)) + ((looking-at c-awk-space*-unclosed-regexp-/-re) ; Unclosed /regexp + (condition-case nil + (progn + (forward-sexp) + (backward-char)) ; Move to end of (logical) line. + (error (end-of-line)))) ; Happens at EOB. + (t ; division sign + (c-forward-syntactic-ws) + (forward-char)))) + (< (point) bol)) + (forward-line)) (and (eq (point) pos-or-point) (progn (while (and (eq (setq nl-prop (c-awk-get-NL-prop-cur-line)) ?\\) === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2013-07-27 12:07:43 +0000 +++ lisp/progmodes/cc-engine.el 2013-08-25 10:09:56 +0000 @@ -1271,6 +1271,9 @@ (throw 'done (point))))) ;; In trailing space after an as yet undetected virtual semicolon? (c-backward-syntactic-ws from) + (when (and (bolp) (not (bobp))) ; Can happen in AWK Mode with an + ; unterminated string/regexp. + (backward-char)) (if (and (< (point) to) (c-at-vsemi-p)) (point) ------------------------------------------------------------ revno: 113991 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2013-08-24 18:21:05 +0300 message: Add commentary for the last commit. diff: === modified file 'src/xdisp.c' --- src/xdisp.c 2013-08-24 12:59:13 +0000 +++ src/xdisp.c 2013-08-24 15:21:05 +0000 @@ -7050,6 +7050,8 @@ } } } + /* next_element_from_display_vector sets this flag according to + faces of the display vector glyphs, see there. */ else if (it->method != GET_FROM_DISPLAY_VECTOR) { int face_id = face_after_it_pos (it);