Ihor Radchenko 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