Michael Welsh Duggan writes: >>> There is generally no way to re-create it, so I've stopped reporting >>> these. I wish there were some way to record all actions in c-mode >>> buffers such that they could be saved and re-played when this type of >>> problem happens. If there were some sort of debug flag I could turn >>> on, I would turn it on by default and hopefully be able to catch some >>> useful information. >> >> M-x c-toggle-parse-state-debug >> >> (or (c-toggle-parse-state-debug 1) in your .emacs). Warning: variable >> `c-debug-parse-state' is not buffer local. I wrote this on 19th October >> last year to help sort out the bug you reported a little earlier. :-) > > I will turn this on. Okay, I have something repeatable. This is with an older checkout ("109494 dmantipov@yandex.ru-20120807112841-k0pyiinoxi2llcmu"), so I'm updating my sources to see if this holds in the current bzr. In the meantime, here's a recipe that works in the above version. 1) emacs -Q 2) C-x C-f 3) M-x c-toggle-parse-state-debug RET 4) C-v until you get a state inconsistency message (10 times for me) c-parse-state inconsistency at 9942: using cache: (9866 9516 5134 5090), from scratch: (9866 9516 (7654 . 9439) 5134 5090) Old state: (setq c-state-cache '(9516 5134 5090) c-state-cache-good-pos 10231 c-state-nonlit-pos-cache '(15063 12049 9049 6049 3049) c-state-nonlit-pos-cache-limit 15063 c-state-brace-pair-desert '(9516 . 9818) c-state-point-min 1 c-state-point-min-lit-type nil c-state-point-min-lit-start nil c-state-min-scan-pos 1 c-state-old-cpp-beg nil c-state-old-cpp-end nil) c-parse-state inconsistency at 9942: using cache: (9866 9516 5134 5090), from scratch: (9866 9516 (7654 . 9439) 5134 5090) Old state: (setq c-state-cache '(9866 9516 5134 5090) c-state-cache-good-pos 9867 c-state-nonlit-pos-cache '(15063 12049 9049 6049 3049) c-state-nonlit-pos-cache-limit 15063 c-state-brace-pair-desert '(9516 . 9818) c-state-point-min 1 c-state-point-min-lit-type nil c-state-point-min-lit-start nil c-state-min-scan-pos 1 c-state-old-cpp-beg nil c-state-old-cpp-end nil)