emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] ob-tangle: Add flag to optionally remove files before writin


From: Ihor Radchenko
Subject: Re: [PATCH] ob-tangle: Add flag to optionally remove files before writing
Date: Sun, 28 Jan 2024 21:11:39 +0000

Olivier Lischer <olivier.lischer@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

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