[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: permissions on created files
From: |
Glenn Morris |
Subject: |
Re: permissions on created files |
Date: |
Mon, 18 Sep 2006 19:01:08 -0700 |
User-agent: |
Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) |
Urs Thuermann wrote:
> When emacs creates a new file, it does so using mode 0666 modified
> by the process umask, i.e. newly created files don't have the
> executable bit set. I have search the Emacs docs (with C-h i) and
> have also tried C-h a to find a way to change this. I'd like to
> change emacs' behavior so that it uses 0777 instead 0666 when the
> file begins with the two characters #!.
Modes like sh-mode generally do the Right Thing, if you use the
appropriate command (eg sh-set-shell) to set the interpreter.
Otherwise, try:
(and (fboundp 'executable-make-buffer-file-executable-if-script-p)
(add-hook 'after-save-hook
'executable-make-buffer-file-executable-if-script-p))