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: Olivier Lischer
Subject: Re: [PATCH] ob-tangle: Add flag to optionally remove files before writing
Date: Sun, 28 Jan 2024 20:07:33 +0100
User-agent: mu4e 1.10.8; emacs 29.2

Ihor Radchenko <yantar92@posteo.net> writes:

> Olivier Lischer <olivier.lischer@liolin.ch> writes:
>
>> In December last year was a change introduced, that a file should not be
>> removed before
>> tangling (https://lists.gnu.org/r/emacs-orgmode/2021-05/msg00337.html).
>> In an older bug report
>> (https://lists.gnu.org/r/emacs-orgmode/2021-05/msg00337.html)
>> the decision was to remove the file before writing.
>> I added a variable to switch between both behaviors.
>
> 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.
There are also other people with the same workflow. See an older post to
the mailing list
(https://lists.gnu.org/r/emacs-orgmode/2021-05/msg00337.html).

Some other have the opposite problem. They do not want the function to
remove the file before tangling because it is a symlink.
See this post on the mailing list
(https://list.orgmode.org/orgmode/CAPHku6O9NfVMAfmE3_ahmpJea_2Qm0mJMFX6qPpT8uiQ94KMZA@mail.gmail.com/)

To achieve both use cases, I think an additional variable could be
useful.

Best Regards
Oli



reply via email to

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