[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: write-file could carry permissions

From: Stefan Monnier
Subject: Re: write-file could carry permissions
Date: Tue, 13 May 2003 10:12:52 -0400

>     $ chmod +x something
>     $ emacs something
>     C-x C-w somethingelse
>     $ ls -l #shows that the executable permissions were not carried along,
>     as a convenience...
> If you write the buffer into a different file, I don't see why the
> permissions would be the same.  However, this suggested to me that
> maybe Emacs should always set the executable bit when you edit a file
> in Shell Script mode.  Is there any reason that would be bad?

As someone already pointed out,
we have make-buffer-file-executable-if-script-p and I recommend everybody
add it to his after-save-hook.

As for making all sh-script mode buffer executable, I strongly
oppose this idea, since many script files are never meant to be executed,
but only sourced (this is the case for .bashrc kind of things for example,
but also for many other files when you write an extensive script and
split it into modules/libraries/...).

Another reason why I oppose this idea is because the after-save-hook
setting above is a much better solution which also covers awk scripts,
prl scripts, foo scripts, bar scripts, ...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]