org-element--cache-before-change: Make sure that rx expr is always valid

* lisp/org-element.el (org-element--cache-before-change): Make sure
that we never construct (repeat 1 0 "*") rx expr.

Hopefully fixes https://list.orgmode.org/d8749145-29b9-39d6-5bbe-4b7e765792e5@ctpowe.net/T/#u
This commit is contained in:
Ihor Radchenko 2021-11-22 19:38:36 +08:00
parent 7a14d6035c
commit 17d4b31a84
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 1 deletions

View File

@ -6534,7 +6534,8 @@ The function returns the new value of `org-element--cache-change-warning'."
(let (min-level)
(cl-loop while (re-search-forward
(rx-to-string
(if min-level
(if (and min-level
(> min-level 1))
`(and bol (repeat 1 ,(1- min-level) "*") " ")
`(and bol (+ "*") " ")))
bottom t)