branch: externals/org
commit 13353f1fa34f6f085ffbf142b380af7308f02981
Author: Ihor Radchenko <yanta...@posteo.net>
Commit: Ihor Radchenko <yanta...@posteo.net>

    org-fold-hide-drawer-all: Make interactive
    
    * lisp/org-fold.el (org-fold-hide-drawer-all): Convert into
    interactive command.  Accept two optional arguments - region
    boundaries.
    * etc/ORG-NEWS (~org-fold-hide-drawer-all~ is now interactive):
    Document the change.
    
    Link: 
https://orgmode.org/list/cafmwt7wemvgvyqhp8nczy5vzmzz4ncvbjchd4jbqghcpwjo...@mail.gmail.com
---
 etc/ORG-NEWS     | 5 +++++
 lisp/org-fold.el | 9 +++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 14f98d2b92..78b75b5787 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -626,6 +626,11 @@ Maxima's graphics packages (~draw~ or ~plot~); the default 
remains
 of the file-name set in the ~:file~ header argument.
 
 ** New functions and changes in function arguments
+*** ~org-fold-hide-drawer-all~ is now interactive
+
+~org-fold-hide-drawer-all~ is now a command, accepting two optional
+arguments - region to act on.
+
 *** =TYPES= argument in ~org-element-lineage~ can now be a symbol
 
 When =TYPES= is symbol, only check syntax nodes of that type.
diff --git a/lisp/org-fold.el b/lisp/org-fold.el
index 18ccbf0bb7..d1a270df65 100644
--- a/lisp/org-fold.el
+++ b/lisp/org-fold.el
@@ -593,10 +593,11 @@ Return a non-nil value when toggling is successful."
   (interactive)
   (org-block-map (apply-partially #'org-fold-hide-block-toggle 'hide)))
 
-(defun org-fold-hide-drawer-all ()
-  "Fold all drawers in the current buffer."
-  (let ((begin (point-min))
-        (end (point-max)))
+(defun org-fold-hide-drawer-all (&optional begin end)
+  "Fold all drawers in the current buffer or active region BEGIN..END."
+  (interactive "r")
+  (let ((begin (or begin (point-min)))
+        (end (or end (point-max))))
     (org-fold--hide-drawers begin end)))
 
 (defun org-fold--hide-drawers (begin end)

Reply via email to