[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 65885cc: c-renarrow-state-cache: take care when new
From: |
Alan Mackenzie |
Subject: |
[Emacs-diffs] master 65885cc: c-renarrow-state-cache: take care when new point is inside old brace pair. |
Date: |
Sun, 19 Jun 2016 11:27:56 +0000 (UTC) |
branch: master
commit 65885ccf29ce4723f100a45756005781e8e7ab46
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>
c-renarrow-state-cache: take care when new point is inside old brace pair.
Also add display of point-min to the c-parse-state debugging output.
* lisp/progmodes/cc-engine.el (c-renarrow-state-cache): When the new
point is inside an old recorded brace pair, clear the cache.
(c-debug-parse-state): Output the value of point-min.
---
lisp/progmodes/cc-engine.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 32eca3e..011d080 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -2752,7 +2752,11 @@ comment at the start of cc-engine.el for more info."
(setq ptr (cdr ptr)))
(when (consp ptr)
- (if (eq (cdr ptr) c-state-cache)
+ (if (or (eq (cdr ptr) c-state-cache)
+ (and (consp (cadr ptr))
+ (> (cdr (cadr ptr)) (point-min)))) ; Our new point-min is
+ ; inside a recorded
+ ; brace pair.
(setq c-state-cache nil
c-state-cache-good-pos c-state-min-scan-pos)
(setcdr ptr nil)
@@ -3603,7 +3607,7 @@ comment at the start of cc-engine.el for more info."
conses-not-ok))
(defun c-debug-parse-state ()
- (let ((here (point)) (res1 (c-real-parse-state)) res2)
+ (let ((here (point)) (min-point (point-min)) (res1 (c-real-parse-state))
res2)
(let ((c-state-cache nil)
(c-state-cache-good-pos 1)
(c-state-nonlit-pos-cache nil)
@@ -3630,8 +3634,8 @@ comment at the start of cc-engine.el for more info."
;; "using cache: %s, from scratch: %s")
;; here res1 res2)))
(message (concat "c-parse-state inconsistency at %s: "
- "using cache: %s, from scratch: %s")
- here res1 res2)
+ "using cache: %s, from scratch: %s. POINT-MIN: %s")
+ here res1 res2 min-point)
(message "Old state:")
(c-replay-parse-state-state))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 65885cc: c-renarrow-state-cache: take care when new point is inside old brace pair.,
Alan Mackenzie <=