]> git.eshelyaron.com Git - dict.git/commitdiff
FIXED: possible infinite loop looking for next term
authorEshel Yaron <me@eshelyaron.com>
Tue, 22 Nov 2022 08:37:51 +0000 (10:37 +0200)
committerEshel Yaron <me@eshelyaron.com>
Tue, 22 Nov 2022 08:38:20 +0000 (10:38 +0200)
* sweeprolog.el (sweeprolog-beginning-of-next-top-term): handle
comments more reliably

sweeprolog.el

index fb22520eeb8fd6a5c2147d080d23979ba06951fe..d3d4b4e559bab89f874ce9849dbef6ad1827ff71 100644 (file)
@@ -2475,7 +2475,7 @@ Interactively, POINT is set to the current point."
       (forward-char)
       (re-search-forward (rx bol graph) nil t)
       (while (and (or (nth 8 (syntax-ppss))
-                      (nth 8 (syntax-ppss (1+ (point)))))
+                      (looking-at-p (rx bol (or "%" "/*"))))
                   (not (eobp)))
         (re-search-forward (rx bol graph) nil t))
       (setq times (1- times)))
@@ -2483,7 +2483,7 @@ Interactively, POINT is set to the current point."
       (setq times (1- times))
       (re-search-forward (rx bol graph) nil t)
       (while (and (or (nth 8 (syntax-ppss))
-                      (nth 8 (syntax-ppss (1+ (point)))))
+                      (looking-at-p (rx bol (or "%" "/*"))))
                   (not (eobp)))
         (re-search-forward (rx bol graph) nil t)))
     (beginning-of-line)