From 0657992475cdaa1e8493f294f78ee57e4aa47451 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Tue, 22 Nov 2022 10:37:51 +0200 Subject: [PATCH] FIXED: possible infinite loop looking for next term * sweeprolog.el (sweeprolog-beginning-of-next-top-term): handle comments more reliably --- sweeprolog.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sweeprolog.el b/sweeprolog.el index fb22520..d3d4b4e 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -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) -- 2.39.2