From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: write-file could carry permissions Date: Tue, 13 May 2003 10:12:52 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200305131412.h4DECqJo012114@rum.cs.yale.edu> References: <87ptmpm75y.fsf@jidanni.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1052836446 13220 80.91.224.249 (13 May 2003 14:34:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 13 May 2003 14:34:06 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue May 13 16:34:03 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19FapS-0003Kq-00 for ; Tue, 13 May 2003 16:32:30 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19FawN-0004lZ-00 for ; Tue, 13 May 2003 16:39:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19FaqT-0001CV-02 for emacs-devel@quimby.gnus.org; Tue, 13 May 2003 10:33:33 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19Fap4-0000bb-00 for emacs-devel@gnu.org; Tue, 13 May 2003 10:32:06 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19FahN-0006Sh-00 for emacs-devel@gnu.org; Tue, 13 May 2003 10:24:10 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19FaWV-0003Uv-00; Tue, 13 May 2003 10:12:55 -0400 Original-Received: from rum.cs.yale.edu (localhost [127.0.0.1]) by rum.cs.yale.edu (8.12.8/8.12.8) with ESMTP id h4DECqx6012116; Tue, 13 May 2003 10:12:52 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.12.8/8.12.8/Submit) id h4DECqJo012114; Tue, 13 May 2003 10:12:52 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Richard Stallman Original-cc: Dan Jacobson X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13830 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13830 > $ 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, ... Stefan