emacs-devel
[Top][All Lists]
Advanced

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

Re: write-file could carry permissions


From: Ehud Karni
Subject: Re: write-file could carry permissions
Date: Tue, 13 May 2003 13:28:23 +0300

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 13 May 2003 00:39:27 -0400, Thien-Thi Nguyen <address@hidden> wrote:
> 
>    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?
> 
> if you write a file in a directory where some cron-driven script
> walker sees it, it is better if that file is not executable unless
> you explicitly make it so.  (principle of least surprise according
> to the sysadmin.)
> 
> on the other hand, there's no problem w/ emacs providing a
> convenient way to effect this decision (e.g., a write-file hook
> subject to y-or-n-p).

There is an autoloaded function supplied in current emacs (21.3) that
does that - `executable-make-buffer-file-executable-if-script-p' in 
progmode/executable.el. Just add it to `after-save-hook'.

BTW. Beside Thien-Thi reservation about cron confusion, there is also
the problem of trying to change file mode on remote system (ange-ftp)
that usually fails (remote chmod not supported).

Ehud.


- -- 
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 mailto:address@hidden                  Better  Safe  Than  Sorry
-----BEGIN PGP SIGNATURE-----
Comment: use http://www.keyserver.net/ to get my key (and others)

iD8DBQE+wMjHLFvTvpjqOY0RApHKAJ9wk3cZPHx5R8/73iXEf4NFwg+pxQCfX9Ed
RN/VHFQueZXC6pXBz05xtRQ=
=2x+H
-----END PGP SIGNATURE-----




reply via email to

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