# HG changeset patch # User Martin Stjernholm # Date 1029880731 0 # Node ID 35f3b5d4f9187aaff38a0061d6151bc435e997c2 # Parent 076f60a8d04bde30021fb7faadcf543f72c3fbd2 (c-forward-syntactic-ws): Fixed a bug that could cause an infinite loop if something that looks like a macro begins in the middle of a line. (c-parse-state): Fixed a bug that could cause `c-state-cache' to contain two conses in sequence when there's an unbalanced open paren in a macro. diff -r 076f60a8d04b -r 35f3b5d4f918 lisp/progmodes/cc-engine.el --- a/lisp/progmodes/cc-engine.el Tue Aug 20 20:35:56 2002 +0000 +++ b/lisp/progmodes/cc-engine.el Tue Aug 20 21:58:51 2002 +0000 @@ -642,8 +642,9 @@ (forward-char)) ;; Skip preprocessor directives. ((and (looking-at "#[ \t]*[a-zA-Z0-9!]") - (progn (skip-chars-backward " \t") - (bolp))) + (save-excursion + (skip-chars-backward " \t") + (bolp))) (end-of-line) (while (and (<= (point) lim) (eq (char-before) ?\\) @@ -1245,6 +1246,11 @@ (setq c-state-cache (cdr c-state-cache))) (setq pairs (car pairs)) (setcar pairs (1- (car pairs))) + (when (consp (car-safe c-state-cache)) + ;; There could already be a cons first in `c-state-cache' + ;; if we've jumped over an unbalanced open paren in a + ;; macro below. + (setq c-state-cache (cdr c-state-cache))) (setq c-state-cache (cons pairs c-state-cache))) (if last-pos ;; Prepare to loop, but record the open paren only if it's