From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai =?iso-8859-15?q?Gro=DFjohann?=) Newsgroups: gmane.emacs.devel Subject: Re: Run coding system auto-detection manually? Date: Tue, 06 Aug 2002 11:48:33 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: References: <200208060150.g761oMF28979@wijiji.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1028627307 21873 127.0.0.1 (6 Aug 2002 09:48:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 6 Aug 2002 09:48:27 +0000 (UTC) Cc: eliz@is.elta.co.il, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17c0wz-0005gf-00 for ; Tue, 06 Aug 2002 11:48:25 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17c1I3-0002hO-00 for ; Tue, 06 Aug 2002 12:10:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17c0xc-0004X2-00; Tue, 06 Aug 2002 05:49:04 -0400 Original-Received: from waldorf.cs.uni-dortmund.de ([129.217.4.42]) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17c0xK-0004Uf-00; Tue, 06 Aug 2002 05:48:47 -0400 Original-Received: from lothlorien.cs.uni-dortmund.de (lothlorien [129.217.19.67]) by waldorf.cs.uni-dortmund.de with ESMTP id g769meb12582; Tue, 6 Aug 2002 11:48:40 +0200 (MES) Original-Received: from lucy.cs.uni-dortmund.de (lucy [129.217.19.80]) by lothlorien.cs.uni-dortmund.de id LAA11616; Tue, 6 Aug 2002 11:48:33 +0200 (MET DST) Original-Received: by lucy.cs.uni-dortmund.de (Postfix, from userid 6104) id 658843ADDC; Tue, 6 Aug 2002 11:48:33 +0200 (CEST) Original-To: rms@gnu.org In-Reply-To: <200208060150.g761oMF28979@wijiji.santafe.edu> (Richard Stallman's message of "Mon, 5 Aug 2002 19:50:22 -0600 (MDT)") Original-Lines: 44 User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6305 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6305 Richard Stallman writes: > When the file is precious, Emacs already writes to a different file > first and then renames the file. Therefore, the spot where Emacs > invokes write-region if the file is precious must already take care > of this. At that spot, (the function called from) save-buffer just > passes the real file name as the LOCKNAME argument. > > I don't think write-region looks at the LOCKNAME argument in > deciding which coding system to use. I think it looks only at > the FILENAME argument. > > Handa, do you think it looks at LOCKNAME? > > Is this a bug in the handling of coding systems for precious files? I'm sorry, I confused LOCKNAME and VISIT. After looking again in basic-save-buffer-2, I see the following call: (write-region (point-min) (point-max) tempname nil realname buffer-file-truename) This is in the "precious" case. So you can see that the real filename is in the VISIT argument, not in the LOCKNAME argument. I got those two confused before. Presumably, the intent was that write-region choose the coding system based on realname instead of tempname. But looking in the code for write-region, I don't find any evidence that it looks at VISIT, only at FILENAME, for detecting the coding system. Hm. Maybe in the above call, tempname has been devised in such a way that choose_write_coding_system chooses the "right" coding. I'm somewhat confused at the moment. Can somebody clear up the confusion? Is there a bug (regarding VISIT instead of LOCKNAME), as Richard suggests? Or does the code work right? kai -- A large number of young women don't trust men with beards. (BFBS Radio)