I currently have
(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)
in my config to automatically make scripts executable when saving them. However, I personally don't like that this means that also the autosaved files ending in
myscript.sh~, will automatically be rendered executable.
So my question is:
How can I automatically make only files not ending in
~ executable upon save? I guess one has to write a small wrapper function, but my elisp skills are quite under-developed ... Any help is appreciated!