From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dan Jacobson Newsgroups: gmane.emacs.bugs Subject: C-x C-w should be hip to current file permissions Date: 11 Nov 2002 15:15:41 +0800 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: <8765v4y3tu.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 1037005520 13870 80.91.224.249 (11 Nov 2002 09:05:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 11 Nov 2002 09:05:20 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18BAVS-0003ba-00 for ; Mon, 11 Nov 2002 10:05:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18BAWk-0006xR-00; Mon, 11 Nov 2002 04:06:38 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18BAIR-0002Vm-00 for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2002 03:51:51 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18BAIL-0002RO-00 for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2002 03:51:50 -0500 Original-Received: from main.gmane.org ([80.91.224.249]) by monty-python.gnu.org with esmtp (Exim 4.10) id 18BAIK-0002OA-00 for bug-gnu-emacs@gnu.org; Mon, 11 Nov 2002 03:51:45 -0500 Original-Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18BAGh-00033L-00 for ; Mon, 11 Nov 2002 09:50:03 +0100 Original-To: bug-gnu-emacs@gnu.org X-Injected-Via-Gmane: http://gmane.org/ Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 18BA8v-0002k3-00 for ; Mon, 11 Nov 2002 09:42:01 +0100 Original-Path: 127.0.0.1!nobody Original-Lines: 17 Original-NNTP-Posting-Host: tc218-187-81-110.2-7.pl.apol.com.tw Original-X-Trace: main.gmane.org 1037004121 10387 218.187.81.110 (11 Nov 2002 08:42:01 GMT) Original-X-Complaints-To: usenet@main.gmane.org Original-NNTP-Posting-Date: Mon, 11 Nov 2002 08:42:01 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:3865 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:3865 I edited an existing shell script [mode 744] and used C-x C-w to write it into a new file. I notice that that files modes were just my plain umask modes and I had to take the time to make it executable. And what if I had been editing a 600 file, would a C-x C-w version become 644 spilling my beans? Info says: `C-x C-w' (`write-file'). It is precisely equivalent to `set-visited-file-name' followed by `C-x C-s'. `C-x C-s' used on a buffer that is not visiting a file has the same effect as `C-x C-w'; that is, it reads a file name, marks the buffer as visiting that file, and saves it there. So there's more to consider. Anyway C-h k C-x C-w should give a clear statement about what happens to permissions, and so should Info. -- http://jidanni.org/ Taiwan(04)25854780