Tor Kringeland <[email protected]> writes:
> Ihor Radchenko <[email protected]> writes:
>
>> Sure. Now, you need to call a different function to open all the drawers
>> unconditionally. That function is:
>>
> Thanks! This almost imitates the old behavior, except that all drawers
> (i.e., including sub-headlines) would be opened when the headline it was
> a part of was opened. (So pressing TAB multiple times would first show
> the outline with the first headline open, then the next would show
> sub-headlines with their drawers open.)
I am a bit confused. The code I provided should only open the drawers
inside the headline at point, before its first child (if any).
If you have
* headline
:drawer:
test
:end:
** child
:drawer2:
test
:end:
then only "drawer" will be revealed. Not "drawer2".
If you want all the drawers in all the children to be opened, you can
instead do the following:
(let* ((headline (save-excursion (org-back-to-heading) (org-element-at-point))))
(when headline
(org-fold-region
(org-element-property :begin headline)
(org-element-property :end headline)
nil 'drawer)))
>> Though we might also modify org-fold-show-entry to allow what you wish.
>> I am not sure here.
>
> That sounds nice. So an optional behavior would be for it to open the
> drawers as well, which I guess would lead to the "recursive" behavior
> above I mentioned working, right?
I am not sure. Can you elaborate what exactly you want to achieve?
Best,
Ihor