>>> (unless (or (org-in-commented-heading-p)
>>>           (org-in-archived-heading-p))
>>>     ...)
> This is a bit more tricky than just tangling. Code evaluation is also
> affected. Same for reference resolution.
If we only modify the `unless` condition inside
org-babel-tangle-collect-blocks, code evaluation should not be
affected. However, I understand your concern: indeed, we should first
carefully figure out whether the current behavior should be adjusted
or not.

> I think commented headings are pretty clear. They should be
> ignored. That's the purpose of comment after all. Same with other
> comment markup.
I agree with you on the commented headings and comment markup. They
should remain ignored. Let's only discuss the archive behavior later.

>For archiving, I can see how this may depend on user taste.
>Could you please provide more details about your workflow? Do you really
>need archived subtrees?
Yes, in my workflow I do rely on archived subtrees.

I maintain an accounting Org file that generates yearly journal files.
After closing a fiscal year, I archive the corresponding headline.
However, the ledger entries under that archived headline still need to
be tangled, just like the current year's entries.

A simplified example of my setup is shown below:
```
#+TITLE: Accounting

* Reports
** Yearly incomestatement

#+begin_src hledger :cmdline bal
include ~/2024.journal
include ~/2025.journal
include ~/2026.journal
#+end_src

#+RESULTS:
:              -75 USD  Assets:Bank
:               75 USD  Expenses:Food
: --------------------
:                    0

* 2026

#+begin_src ledger :tangle "~/2026.journal"
2026/01/01 * Food
    Expenses:Food                                 26 USD
    Assets:Bank
#+end_src

* 2025                                                   :ARCHIVE:

#+begin_src ledger :tangle "~/2025.journal"
2025/01/01 * Food
    Expenses:Food                                 25 USD
    Assets:Bank
#+end_src

* 2024                                                   :ARCHIVE:

#+begin_src ledger :tangle "~/2024.journal"
2024/01/01 * Food
    Expenses:Food                                 24 USD
    Assets:Bank
#+end_src
```
Archiving helps keep the file visually organized after year-end, but
from a tangling perspective those entries are still active and should
be tangled.

Because this may ultimately be a matter of user preference, making the
treatment of archived subtrees configurable (for example, via a
defcustom) would allow users like me to adapt the behavior to their
workflow without altering the current default for others.

Best regard,
llcc

On Sun, Feb 8, 2026 at 7:30 PM Ihor Radchenko <[email protected]> wrote:
>
> Ihor Radchenko <[email protected]> writes:
>
> > Rudolf Adamkovič <[email protected]> writes:
> >
> >> Speaking of "pretty clear", about the attached patch? :)
> >> ...
> >> +is executed or tangled[fn:: For less restrictive export limitations,
> >> +consider using a select tag (see [[*Export Settings]]) instead.].  The
> >> +command below helps to change the comment status of a headline.
> >
> > This is OK, but I would not expect users to search for caveats of
> > COMMENT keyword during tangling in "Export" section of the manual.
>
> Applied, onto main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=dca672959
> I additionally documented about disabled tangling for comment trees in
> the relevant section.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=8da0562b4
>
> --
> Ihor Radchenko // yantar92,
> Org mode maintainer,
> 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>

Reply via email to