(add-hook 'after-save-hook 'executable-make-buffer-file-executable-if-script-p)

http://d.hatena.ne.jp/hnw/20140115