]> git.eshelyaron.com Git - emacs.git/commitdiff
Correct loop termination condition in c-syntactic-skip-backward.
authorAlan Mackenzie <acm@muc.de>
Sat, 2 Aug 2014 16:42:29 +0000 (16:42 +0000)
committerAlan Mackenzie <acm@muc.de>
Sat, 2 Aug 2014 16:42:29 +0000 (16:42 +0000)
progmodes/cc-engine.el (c-syntactic-skip-backward): Correct for the
situation where, after moving back out of a literal, skip-chars-backward
doesn't move further, yet checks have still to be done.

lisp/ChangeLog
lisp/progmodes/cc-engine.el

index 531cbe5aeede6c1d027e9acba0b04c0ec6d4fef7..83975cb885b203633b5c6b8d98aa92a974ddfd6f 100644 (file)
@@ -1,3 +1,11 @@
+2014-08-02  Alan Mackenzie  <acm@muc.de>
+
+       Correct loop termination condition in c-syntactic-skip-backward.
+       * progmodes/cc-engine.el (c-syntactic-skip-backward): Correct for
+       the situation where, after moving back out of a literal,
+       skip-chars-backward doesn't move further, yet checks have still to
+       be done.
+
 2014-08-01  Eli Zaretskii  <eliz@gnu.org>
 
        * tutorial.el (tutorial--display-changes): Accept punctuation
index 7404241af9b91dba5585448b95aae49348eb72c2..0a96b155498e61f9f80f023349c7961db9170f28 100644 (file)
@@ -4245,16 +4245,18 @@ comment at the start of cc-engine.el for more info."
          ;; loops when it hasn't succeeded.
          (while
              (and
-              (< (skip-chars-backward skip-chars limit) 0)
+              (let ((pos (point)))
+                (while (and
+                        (< (skip-chars-backward skip-chars limit) 0)
+                        ;; Don't stop inside a literal.
+                        (when (setq lit-beg (c-ssb-lit-begin))
+                          (goto-char lit-beg)
+                          t)))
+                (< (point) pos))
 
               (let ((pos (point)) state-2 pps-end-pos)
 
                 (cond
-                 ;; Don't stop inside a literal
-                 ((setq lit-beg (c-ssb-lit-begin))
-                  (goto-char lit-beg)
-                  t)
-
                  ((and paren-level
                        (save-excursion
                          (setq state-2 (parse-partial-sexp