summaryrefslogtreecommitdiff
path: root/org-fc.el
diff options
context:
space:
mode:
authorLeon Rische <leon.rische@me.com>2020-07-13 01:26:57 +0200
committerLeon Rische <leon.rische@me.com>2020-07-13 01:26:57 +0200
commit634d837a8aa7138f55d7a697876a3bf7cec1b015 (patch)
treebc4ade133f4a4369d6e80fba98e013edff5b7449 /org-fc.el
parentbb5536ee54366ca9d56fdf6e65091c23902a9030 (diff)
Only hide drawers of the current headline
Diffstat (limited to 'org-fc.el')
-rw-r--r--org-fc.el23
1 files changed, 12 insertions, 11 deletions
diff --git a/org-fc.el b/org-fc.el
index c688e4a..2810d1b 100644
--- a/org-fc.el
+++ b/org-fc.el
@@ -1042,17 +1042,18 @@ FACE can be used to set the text face of the overlay."
(defun org-fc-hide-drawers ()
"Hide all drawers except ones in `org-fc-drawer-whitelist' after point."
- (save-excursion
- (while (re-search-forward org-drawer-regexp nil t)
- (let ((start (1- (match-beginning 0)))
- (name (match-string 1))
- (end))
- (if (re-search-forward ":END:" nil t)
- (setq end (point))
- (error "No :END: found for drawer"))
- (if (member name org-fc-drawer-whitelist)
- (org-flag-drawer nil nil start end)
- (org-fc-hide-region start end))))))
+ (let ((bound (org-element-property :end (org-element-at-point))))
+ (save-excursion
+ (while (re-search-forward org-drawer-regexp bound t)
+ (let ((start (1- (match-beginning 0)))
+ (name (match-string 1))
+ (end))
+ (if (re-search-forward ":END:" bound t)
+ (setq end (point))
+ (error "No :END: found for drawer"))
+ (if (member name org-fc-drawer-whitelist)
+ (org-flag-drawer nil nil start end)
+ (org-fc-hide-region start end)))))))
;;;; Hiding Headings / Section Contents