Fix a loop in c-set-fl-decl-start.

This commit is contained in:
Alan Mackenzie 2012-02-13 17:18:07 +00:00
parent af70074f2f
commit c14fcc9571
2 changed files with 14 additions and 6 deletions

View file

@ -1,3 +1,10 @@
2012-02-13 Alan Mackenzie <acm@muc.de>
Fix a loop in c-set-fl-decl-start.
* progmodes/cc-engine (c-set-fl-decl-start): Add a check that
c-backward-syntactic-ws actually moves backwards.
2012-02-13 Leo Liu <sdl.web@gmail.com>
* net/rcirc.el (rcirc-markup-attributes): Move point to the

View file

@ -1114,7 +1114,7 @@ Note that the style variables are always made local to the buffer."
(goto-char (c-point 'bol new-pos))
(when lit-limits ; Comment or string.
(goto-char (car lit-limits)))
(setq bod-lim (max (- (point) 500) (point-min)))
(setq bod-lim (c-determine-limit 500))
(while
;; Go to a less nested declaration each time round this loop.
@ -1132,11 +1132,12 @@ Note that the style variables are always made local to the buffer."
;; Try and go out a level to search again.
(progn
(c-backward-syntactic-ws bod-lim)
(or (memq (char-before) '(?\( ?\[))
(and (eq (char-before) ?\<)
(eq (c-get-char-property
(1- (point)) 'syntax-table)
c-<-as-paren-syntax))))
(and (> (point) bod-lim)
(or (memq (char-before) '(?\( ?\[))
(and (eq (char-before) ?\<)
(eq (c-get-char-property
(1- (point)) 'syntax-table)
c-<-as-paren-syntax)))))
(not (bobp)))
(backward-char))
new-pos)) ; back over (, [, <.