emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r117629: Correct loop termination condition in c-syn


From: Alan Mackenzie
Subject: [Emacs-diffs] trunk r117629: Correct loop termination condition in c-syntactic-skip-backward.
Date: Sat, 02 Aug 2014 16:48:40 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117629
revision-id: address@hidden
parent: address@hidden
committer: Alan Mackenzie <address@hidden>
branch nick: trunk
timestamp: Sat 2014-08-02 16:42:29 +0000
message:
  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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/cc-engine.el    
ccengine.el-20091113204419-o5vbwnq5f7feedwu-1227
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-08-01 14:49:28 +0000
+++ b/lisp/ChangeLog    2014-08-02 16:42:29 +0000
@@ -1,3 +1,11 @@
+2014-08-02  Alan Mackenzie  <address@hidden>
+
+       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  <address@hidden>
 
        * tutorial.el (tutorial--display-changes): Accept punctuation

=== modified file 'lisp/progmodes/cc-engine.el'
--- a/lisp/progmodes/cc-engine.el       2014-06-29 11:26:47 +0000
+++ b/lisp/progmodes/cc-engine.el       2014-08-02 16:42:29 +0000
@@ -4245,16 +4245,18 @@
          ;; 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


reply via email to

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