emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ANN] lisp/ob-tangle-sync.el


From: Mehmet Tekman
Subject: Re: [ANN] lisp/ob-tangle-sync.el
Date: Thu, 27 Apr 2023 15:01:16 +0200

Ihor Radchenko <yantar92@posteo.net> writes:

> Do I understand correctly that your package is adding the following new
> features:
>
> 1. Automatically manages balanced
>    `org-babel-tangle'/`org-babel-detangle' in Org sources and target
>    buffers.
> 2. Attempts to make more fine-grained tangling/detanging functionality
>    by controlling tangling behaviour on per-src-block basis (via
>    :tangle-sync skip/pull/export/both)
>

That is correct

> If so, I think that (2) probably belongs to the main babel code
> (`org-babel-tangle' and `org-babel-detangle'). Since you are
> contributing to Org directly, you are free to modify these functions as
> you need.
>
> Note that your current approach with `org-babel-tangle-sync-synchronize'
> will give unexpected results when one edits multiple src blocks or the
> corresponding tangled source in multiple places - the :tangle-sync value
> is only checked at point and `org-babel-tangle'/`org-babel-detange' is
> then called for the whole buffer, not just for the current code block.

That's... a really good point. I didn't consider that I'm calling a
tangle or detangle function on an entire file based on the
=:tangle-sync action= of a single block... which might have different
actions in another block for the same file!

I've attached a toy.org file which should explain what the desired
action would be in such a situation, and I fully agree that I will
likely need to modify the current tangle and detangle code so that the
sync direction is on a per-block basis, and not per-file.

I will work on this a bit more and submit a full patch with this in
mind.

Best,
Mehmet

Attachment: toy.org
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]