I am finding myself editing a lot of files that are read-only. I usually hit C-x C-q
to call toggle-read-only
. Then I hit C-x C-s
to save and get,
File foo.txt is write-protected; try to save anyway? (y or n)
After hitting y
, the file is saved and the permissions on the file remain read-only.
Is there a way to shorten this process and make it so that simply saving a file with C-x C-s does the whole thing without prompting? Should I look into inserting chmod
in before-save-hook
and after-save-hook
or is there a better way?