mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-13 10:40:47 +00:00
org-fold-core-get-regions: Search whole buffer when FROM and TO are nil
* lisp/org-fold-core.el (org-fold-core-get-regions): Fix non-intuitive when FROM and TO are nil. Update the docstring. Reported-by: Daniel Mendler
This commit is contained in:
parent
304f18cb72
commit
8b6df19dc7
|
@ -930,6 +930,8 @@ are provided.
|
||||||
|
|
||||||
If FROM is non-nil and TO is nil, search the folded regions at FROM.
|
If FROM is non-nil and TO is nil, search the folded regions at FROM.
|
||||||
|
|
||||||
|
When both FROM and TO are nil, search folded regions in the whole buffer.
|
||||||
|
|
||||||
When SPECS is non-nil it should be a list of folding specs or a symbol.
|
When SPECS is non-nil it should be a list of folding specs or a symbol.
|
||||||
Only return the matching fold types.
|
Only return the matching fold types.
|
||||||
|
|
||||||
|
@ -946,6 +948,9 @@ WITH-MARKERS must be nil when RELATIVE is non-nil."
|
||||||
(unless (listp specs) (setq specs (list specs)))
|
(unless (listp specs) (setq specs (list specs)))
|
||||||
(let (regions region mk-region)
|
(let (regions region mk-region)
|
||||||
(org-with-wide-buffer
|
(org-with-wide-buffer
|
||||||
|
(when (and (not from) (not to))
|
||||||
|
(setq from (point-min)
|
||||||
|
to (point-max)))
|
||||||
(when (and from (not to)) (setq to (point-max)))
|
(when (and from (not to)) (setq to (point-max)))
|
||||||
(when (and from (< from (point-min))) (setq from (point-min)))
|
(when (and from (< from (point-min))) (setq from (point-min)))
|
||||||
(when (and to (> to (point-max))) (setq to (point-max)))
|
(when (and to (> to (point-max))) (setq to (point-max)))
|
||||||
|
|
Loading…
Reference in a new issue