emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r107269: Fix a loop in c-set-fl-decl-


From: Alan Mackenzie
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107269: Fix a loop in c-set-fl-decl-start.
Date: Mon, 13 Feb 2012 17:18:07 +0000
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107269
committer: Alan Mackenzie <address@hidden>
branch nick: cc-mode
timestamp: Mon 2012-02-13 17:18:07 +0000
message:
  Fix a loop in c-set-fl-decl-start.
modified:
  lisp/ChangeLog
  lisp/progmodes/cc-mode.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-02-13 07:54:47 +0000
+++ b/lisp/ChangeLog    2012-02-13 17:18:07 +0000
@@ -1,3 +1,10 @@
+2012-02-13  Alan Mackenzie  <address@hidden>
+
+       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  <address@hidden>
 
        * net/rcirc.el (rcirc-markup-attributes): Move point to the

=== modified file 'lisp/progmodes/cc-mode.el'
--- a/lisp/progmodes/cc-mode.el 2012-02-06 22:08:41 +0000
+++ b/lisp/progmodes/cc-mode.el 2012-02-13 17:18:07 +0000
@@ -1114,7 +1114,7 @@
     (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 @@
         ;; 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 (, [, <.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]