unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* permissions on created files
@ 2006-09-18 17:30 Urs Thuermann
  2006-09-19  2:01 ` Glenn Morris
  2006-09-19  3:11 ` Tim X
  0 siblings, 2 replies; 3+ messages in thread
From: Urs Thuermann @ 2006-09-18 17:30 UTC (permalink / raw)


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 #!.  Is that possible?  I couldn't find anything
like that.


urs

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: permissions on created files
  2006-09-18 17:30 permissions on created files Urs Thuermann
@ 2006-09-19  2:01 ` Glenn Morris
  2006-09-19  3:11 ` Tim X
  1 sibling, 0 replies; 3+ messages in thread
From: Glenn Morris @ 2006-09-19  2:01 UTC (permalink / raw)


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))

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: permissions on created files
  2006-09-18 17:30 permissions on created files Urs Thuermann
  2006-09-19  2:01 ` Glenn Morris
@ 2006-09-19  3:11 ` Tim X
  1 sibling, 0 replies; 3+ messages in thread
From: Tim X @ 2006-09-19  3:11 UTC (permalink / raw)


Urs Thuermann <urs@isnogud.escape.de> writes:

> 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 #!.  Is that possible?  I couldn't find anything
> like that.
>
>
> urs

I think emacs just inherits the default umask from your environment.
However, thre are some variables which can control the setting of
executable bits on script files created within emacs. I'm not sure
what version of emacs you are running, but a quick apropos in emacs 22
brings up the function

executable-make-buffer-file-executable-if-script-p

which sounds promising as a starting point. 

Tim



-- 
tcross (at) rapttech dot com dot au

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-09-19  3:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-18 17:30 permissions on created files Urs Thuermann
2006-09-19  2:01 ` Glenn Morris
2006-09-19  3:11 ` Tim X

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).