Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
0bc5886a
Commit
0bc5886a
authored
Feb 12, 2012
by
Alan Mackenzie
Browse files
Fix infinite loop with long macros.
parent
faccede1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
20 deletions
+26
-20
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/progmodes/cc-engine.el
lisp/progmodes/cc-engine.el
+21
-20
No files found.
lisp/ChangeLog
View file @
0bc5886a
2012-02-12 Alan Mackenzie <acm@muc.de>
Fix infinite loop with long macros.
* cc-engine.el (c-state-safe-place): Handle macros properly.
2012-02-12 Chong Yidong <cyd@gnu.org>
* window.el (display-buffer): Doc fix (Bug#10785).
...
...
lisp/progmodes/cc-engine.el
View file @
0bc5886a
...
...
@@ -2129,7 +2129,7 @@ comment at the start of cc-engine.el for more info."
(widen)
(save-excursion
(let ((c c-state-nonlit-pos-cache)
pos npos lit macro-beg)
pos npos lit macro-beg
macro-end
)
;; Trim the cache to take account of buffer changes.
(while (and c (> (car c) c-state-nonlit-pos-cache-limit))
(setq c (cdr c)))
...
...
@@ -2143,27 +2143,28 @@ comment at the start of cc-engine.el for more info."
;; Add an element to `c-state-nonlit-pos-cache' each iteration.
(and
(<= (setq npos (+ pos c-state-nonlit-pos-interval)) here)
;; Test for being in a literal.
(progn
(setq lit (car (cddr (c-state-pp-to-literal pos npos))))
(cond
((null lit)
(setq pos npos)
t)
((<= (cdr lit) here)
(setq pos (cdr lit))
t)
(t
(setq pos (car lit))
nil))))
(or (null lit)
(prog1 (<= (cdr lit) here)
(setq npos (cdr lit)))))
(goto-char pos)
(when (and (c-beginning-of-macro) (/= (point) pos))
(setq macro-beg (point))
;; Test for being in a macro.
(progn
(goto-char npos)
(setq macro-beg
(and (c-beginning-of-macro) (/= (point) npos) (point)))
(when macro-beg
(c-syntactic-end-of-macro)
(or (eobp) (forward-char))
(setq pos (if (<= (point) here)
(point)
macro-beg)))
(setq macro-end (point)))
(or (null macro-beg)
(prog1 (<= macro-end here)
(setq npos macro-end)))))
(setq pos npos)
(setq c-state-nonlit-pos-cache (cons pos c-state-nonlit-pos-cache)))
(if (> pos c-state-nonlit-pos-cache-limit)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment