From ea487bffb57dc0fc4579ad23ec1fa842cd457baa Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Sun, 18 Feb 2024 11:48:50 +0100 Subject: [PATCH] org-fold-hide-drawer-all: Do not use point and mark when no region is active * lisp/org-fold.el (org-fold-hide-drawer-all): Do not unconditionally use point and mark. Only use region boundaries when the region is active. --- lisp/org-fold.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-fold.el b/lisp/org-fold.el index 4052a59b0..754cb2ee4 100644 --- a/lisp/org-fold.el +++ b/lisp/org-fold.el @@ -595,7 +595,8 @@ Return a non-nil value when toggling is successful." (defun org-fold-hide-drawer-all (&optional begin end) "Fold all drawers in the current buffer or active region BEGIN..END." - (interactive "r") + (interactive (list (and (use-region-p) (region-beginning)) + (and (use-region-p) (region-end)))) (let ((begin (or begin (point-min))) (end (or end (point-max)))) (org-fold--hide-drawers begin end)))