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.
This commit is contained in:
parent
949b49226d
commit
72c67796c2
13
init.el
13
init.el
|
@ -974,23 +974,22 @@ respectively."
|
||||||
(description target)
|
(description target)
|
||||||
(rx-to-string `(seq (or bol (1+ blank))
|
(rx-to-string `(seq (or bol (1+ blank))
|
||||||
"[[" (0+ (not (any "]"))) (regexp ,target) (0+ (not (any "]")))
|
"[[" (0+ (not (any "]"))) (regexp ,target) (0+ (not (any "]")))
|
||||||
;; Added `anything'
|
;; Added .* wildcards
|
||||||
"][" (0+ anything) (regexp ,description) (0+ anything)
|
"][" (regexp ".*") (regexp ,description) (regexp ".*")
|
||||||
"]]")))
|
"]]")))
|
||||||
;; Note that these actually allow empty descriptions
|
;; Note that these actually allow empty descriptions
|
||||||
;; or targets, depending on what they are matching.
|
;; or targets, depending on what they are matching.
|
||||||
(match-desc
|
(match-desc
|
||||||
(match) (rx-to-string `(seq (or bol (1+ blank))
|
(match) (rx-to-string `(seq (or bol (1+ blank))
|
||||||
"[[" (0+ (not (any "]")))
|
"[[" (0+ (not (any "]")))
|
||||||
;; Added `anything'
|
;; Added .* wildcards
|
||||||
"][" (0+ anything) (regexp ,match) (0+ anything)
|
"][" (regexp ".*") (regexp ,match) (regexp ".*")
|
||||||
"]]")))
|
"]]")))
|
||||||
(match-target
|
(match-target
|
||||||
(match) (rx-to-string `(seq (or bol (1+ blank))
|
(match) (rx-to-string `(seq (or bol (1+ blank))
|
||||||
"[[" (0+ (not (any "]"))) (regexp ,match) (0+ (not (any "]")))
|
"[[" (0+ (not (any "]"))) (regexp ,match) (0+ (not (any "]")))
|
||||||
;; Added `anything'
|
;; Removed pattern for description
|
||||||
"][" (0+ anything)
|
"][" ))))
|
||||||
"]]"))))
|
|
||||||
(cond (description-or-target
|
(cond (description-or-target
|
||||||
(rx-to-string `(or (regexp ,(no-desc description-or-target))
|
(rx-to-string `(or (regexp ,(no-desc description-or-target))
|
||||||
(regexp ,(match-desc description-or-target))
|
(regexp ,(match-desc description-or-target))
|
||||||
|
|
Loading…
Reference in New Issue