emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals-release/org 8b6df19dc7 1/2: org-fold-core-get-regions:


From: ELPA Syncer
Subject: [elpa] externals-release/org 8b6df19dc7 1/2: org-fold-core-get-regions: Search whole buffer when FROM and TO are nil
Date: Thu, 8 Dec 2022 07:57:52 -0500 (EST)

branch: externals-release/org
commit 8b6df19dc74d6366a00b16b9adc843bd7f861c2a
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    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
---
 lisp/org-fold-core.el | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lisp/org-fold-core.el b/lisp/org-fold-core.el
index 6818579039..8a451a82b2 100644
--- a/lisp/org-fold-core.el
+++ b/lisp/org-fold-core.el
@@ -930,6 +930,8 @@ are provided.
 
 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.
 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)))
   (let (regions region mk-region)
     (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 (< from (point-min))) (setq from (point-min)))
      (when (and to (> to (point-max))) (setq to (point-max)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]