From b2b9fd5a6f6cfcd81d721713c32dc48bd77e362b Mon Sep 17 00:00:00 2001 From: Tobias Zawada Date: Fri, 28 Jul 2023 00:16:39 +0200 Subject: [PATCH] Addresses #33. Restart search in `adoc-kwf-std` at last prevented match + 1 --- adoc-mode.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/adoc-mode.el b/adoc-mode.el index fa1fa11..bd054b0 100644 --- a/adoc-mode.el +++ b/adoc-mode.el @@ -1577,9 +1577,8 @@ MUST-FREE-GROUPS a list of regexp group numbers which may not match text that has an adoc-reserved text-property with a non-nil value. Likewise, groups in NO-BLOCK-DEL-GROUPS may not contain text having adoc-reserved set to symbol `block-del'." - (let ((found t) (prevented t) saved-point) + (let ((found t) (prevented t)) (while (and found prevented (<= (point) end) (not (eobp))) - (setq saved-point (point)) (setq found (adoc-kwf-search regexp end t)) (setq prevented (and found @@ -1597,7 +1596,7 @@ text having adoc-reserved set to symbol `block-del'." 'adoc-reserved 'block-del))) no-block-del-groups)))) (when (and found prevented (<= (point) end)) - (goto-char (1+ saved-point)))) + (goto-char (1+ (match-beginning 0))))) (and found (not prevented)))) (defun adoc-kwf-attribute-list (end)