Ihor Radchenko writes: > Olivier Lischer 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. I changed the path as you proposed.