emacs-devel
[Top][All Lists]
Advanced

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

Re: Run coding system auto-detection manually?


From: Kai Großjohann
Subject: Re: Run coding system auto-detection manually?
Date: Tue, 06 Aug 2002 11:48:33 +0200
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu)

Richard Stallman <address@hidden> 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)



reply via email to

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