Ihor Radchenko <yanta...@posteo.net> writes:
> Olivier Lischer <olivier.lisc...@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_2qm0mjmfx6qppt8uiq94k...@mail.gmail.com/) To achieve both use cases, I think an additional variable could be useful. Best Regards Oli