[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1] lisp/org-fold.el: Fold header lines in blocks (was: Propos
From: |
Ihor Radchenko |
Subject: |
Re: [PATCH 1] lisp/org-fold.el: Fold header lines in blocks (was: Proposal: folding stacked `#+header:' lines in src blocks) |
Date: |
Tue, 13 Dec 2022 09:19:05 +0000 |
hugo@heagren.com writes:
> Great! I've worked up a patch (well, two patches), attached.
>
> Some details of the implementation:
> - folding blocks now cycles:
> - everything folded (only top header line visible if present,
> otherwise only `#+begin' line visible).
> - all content visible, (header stack folded, top header visible,
> `#+begin' and `#+end' lines visible).
> - everything visible
> - (the second and third are treated as equivalent unless there is
> more than one header line.)
This logic does not really belong to org-fold.el. Rather to
org-cycle.el(org-cycle). Ideally, we need to split `org-cycle' into
smaller functions.
Also, changing default toggle behaviour may break third-party usage.
People now expect flipping between folded/unfolded. Your patch will
change that.
> - renames `org-fold--hide-wrapper-toggle' to
> `org-fold--hide-wrapper-cycle', which seemed more appropriate under
> the circumstances.
Please, no. As I said above, we need to move the cycling logic to
org-cycle. `org-fold--hide-wrapper-toggle' may only be modified to
accept a new value of FORCE other than 'off.
> Some less-than-perfections:
> - I'm not sure what to do about default block folding (as in, how
> blocks are folded when a file is first visited). First, I don't have
> a complete list of things (variables, startup options, etc.) which
> affect it. Secondly, I'm not sure what the behaviour should be now
> that blocks can be in up to three folding states. Advice would be
> appreciated.
We may define default folding state at startup via defcustom.
> - I'm not sure what other documentation I should add. Once this patch
> is stable and people approve of it, I can add a news entry. Should I
> update the manual at all?
Yes. For example, 2.8 Blocks section of the manual. But let's decide
about implementation first. Manual if the last thing to do.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>