org-cycle: Throw an error when `org-cycle-max-level' is not positive
* lisp/org-cycle.el (org-cycle): Avoid cryptic regexp error when `org-cycle-max-level' is not set to positive integer. Reported-by: Alain.Cochard@unistra.fr Link: https://orgmode.org/list/25496.14797.512207.593382@gargle.gargle.HOWL
This commit is contained in:
parent
97951352bb
commit
0773f4980c
|
@ -336,6 +336,10 @@ same as `S-TAB') also when called without prefix argument."
|
||||||
(and org-cycle-level-after-item/entry-creation
|
(and org-cycle-level-after-item/entry-creation
|
||||||
(or (org-cycle-level)
|
(or (org-cycle-level)
|
||||||
(org-cycle-item-indentation))))
|
(org-cycle-item-indentation))))
|
||||||
|
(when (and org-cycle-max-level
|
||||||
|
(or (not (integerp org-cycle-max-level))
|
||||||
|
(< org-cycle-max-level 1)))
|
||||||
|
(user-error "`org-cycle-max-level' must be a positive integer"))
|
||||||
(let* ((limit-level
|
(let* ((limit-level
|
||||||
(or org-cycle-max-level
|
(or org-cycle-max-level
|
||||||
(and (boundp 'org-inlinetask-min-level)
|
(and (boundp 'org-inlinetask-min-level)
|
||||||
|
|
Loading…
Reference in New Issue