]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix a loop in c-set-fl-decl-start.
authorAlan Mackenzie <acm@muc.de>
Mon, 13 Feb 2012 17:18:07 +0000 (17:18 +0000)
committerAlan Mackenzie <acm@muc.de>
Mon, 13 Feb 2012 17:18:07 +0000 (17:18 +0000)
lisp/ChangeLog
lisp/progmodes/cc-mode.el

index 9669fbe70d0cb6f9d04202da7b3ddccf65ca9da6..b3381e951607a6b54c758fc2df971cc275c2172d 100644 (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
index 374c9b434d12493876079204d30afff8d300de24..2eb00e72a76a50ec93551452bb160bc029e9bc51 100644 (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 (, [, <.