+2002-08-20 Martin Stjernholm <bug-cc-mode@gnu.org>
+
+ * progmodes/cc-engine.el (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.
+
+ * progmodes/cc-engine.el (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.
+
2002-08-20 Glenn Morris <gmorris@ast.cam.ac.uk>
* progmodes/fortran.el (fortran-current-defun): Use save-excursion.
(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) ?\\)
(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