From 72c67796c2eabc19cf19559817e04060a0c68873 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Thu, 9 Jun 2022 21:20:55 +0200 Subject: [PATCH] Another try to the fix org-ql link regexp generator The previous version caused stack overflows in the regexp matcher, supposedly because of matching newlines in the description. This should not happend anymore, but description won't be matched anymore of they contain a line break. --- init.el | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/init.el b/init.el index 20c8c4e..f1e1341 100644 --- a/init.el +++ b/init.el @@ -974,23 +974,22 @@ respectively." (description target) (rx-to-string `(seq (or bol (1+ blank)) "[[" (0+ (not (any "]"))) (regexp ,target) (0+ (not (any "]"))) - ;; Added `anything' - "][" (0+ anything) (regexp ,description) (0+ anything) + ;; Added .* wildcards + "][" (regexp ".*") (regexp ,description) (regexp ".*") "]]"))) ;; Note that these actually allow empty descriptions ;; or targets, depending on what they are matching. (match-desc (match) (rx-to-string `(seq (or bol (1+ blank)) "[[" (0+ (not (any "]"))) - ;; Added `anything' - "][" (0+ anything) (regexp ,match) (0+ anything) + ;; Added .* wildcards + "][" (regexp ".*") (regexp ,match) (regexp ".*") "]]"))) (match-target (match) (rx-to-string `(seq (or bol (1+ blank)) "[[" (0+ (not (any "]"))) (regexp ,match) (0+ (not (any "]"))) - ;; Added `anything' - "][" (0+ anything) - "]]")))) + ;; Removed pattern for description + "][" )))) (cond (description-or-target (rx-to-string `(or (regexp ,(no-desc description-or-target)) (regexp ,(match-desc description-or-target))