emacs-devel
[Top][All Lists]
Advanced

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

Re: EOL conversion of files in .tar archives


From: Eli Zaretskii
Subject: Re: EOL conversion of files in .tar archives
Date: Wed, 23 May 2007 10:15:55 +0300

> Cc: address@hidden, address@hidden
> From: Chong Yidong <address@hidden>
> Date: Tue, 22 May 2007 23:18:04 -0400
> 
> Eli Zaretskii <address@hidden> writes:
> >
> > This solves the problem with the EOL decoding, but reveals a very
> > strange phenomenon: dos-w32.el and dos-w32.elc behave differently.
> > ...
> > -       (set-buffer-file-coding-system coding))
> > +       (set-buffer-file-coding-system last-coding-system-used t))
> 
> What's the rationale for this change?

2 reasons: First, without the 3rd arg, set-buffer-file-coding-system
does not force the coding-system of the buffer to `coding', it rather
_merges_ them (see the code for the details).  Second, `coding' could
be `undecided', in which case decode-coding-region would set
last-coding-system-used to the actual encoding it detected and used to
decode the file's contents.  Thus, using last-coding-system-used is
more accurate (and in fact I believe it's TRT on all platforms, not
only on Windows).

> (And I think the use of last-coding-system-used leads to the
> "strange phenomenon" mentioned above.)

No, the ``strange phenomenon'' was observed in the previous patch,
that didn't have this change.

> All this makes me more dubious about adding this code now.  We should
> either make this entire change conditional on win32 (hedious as the
> resulting code might be) or simply postphone it for Emacs 22.2.

I'm okay with conditioning on w32 on the release branch.




reply via email to

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