Olivier Lischer <olivier.lisc...@liolin.ch> writes:

>> Thanks for the patch, but may you please explain why introducing such
>> variable is useful?
>
> Sure.
>
> I configure all my .dotfiles in an Org mode file and tangle the
> configuration in the right places. The tangled files are all
> read-only to prevent accidentally editing of the "right" configuration
> file. With the current tangling mechanism, this results in a "Permission
> denied" error because the function writes to a read-only file. In a
> earlier version this use case was possible because the file was
> recreated before writing to it.

Thanks for the explanation!

I suggest changing your patch, setting the default value of
`org-babel-tangle-remove-file-before-write' to 'auto.
This will keep the current behaviour but fall back to delete + write new
file when the tangle target is read-only.
That will avoid feature regression.

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

Reply via email to