diff options
author | Leon Rische <leon.rische@me.com> | 2020-07-13 01:26:57 +0200 |
---|---|---|
committer | Leon Rische <leon.rische@me.com> | 2020-07-13 01:26:57 +0200 |
commit | 634d837a8aa7138f55d7a697876a3bf7cec1b015 (patch) | |
tree | bc4ade133f4a4369d6e80fba98e013edff5b7449 /org-fc.el | |
parent | bb5536ee54366ca9d56fdf6e65091c23902a9030 (diff) |
Only hide drawers of the current headline
Diffstat (limited to 'org-fc.el')
-rw-r--r-- | org-fc.el | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -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 |