[Top][All Lists]

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

Re: [Emacs-diffs] master db828f6: Don't rely on defaults in decoding UTF

From: Eli Zaretskii
Subject: Re: [Emacs-diffs] master db828f6: Don't rely on defaults in decoding UTF-8 encoded Lisp files
Date: Mon, 28 Sep 2015 09:53:20 +0300

> From: Paul Eggert <address@hidden>
> Date: Sun, 27 Sep 2015 19:41:36 -0700
> Cc: address@hidden
> The discussion has morphed into the possibility of a similar facility for 
> files 
> other than .el files, and what the defaults for such a facility should be.  
> The 
> idea is to somehow avoid the need for UTF-8 coding cookies for users who 
> prefer 
> Emacs to default to UTF-8 for text files regardless of system locale.

I think

  (prefer-coding-system 'utf-8)

is what those users should do, but I'm not sure.  It definitely sets
the defaults for new files and for communicating with sub-processes
(the latter part might not be what you want, btw), but its effect on
decoding existing files might sometimes surprise, due to the way the
priority of trying various decoders is implemented.  (Hint: look at
the implementation of set-coding-priority, the function that is called
under the hood by prefer-coding-system.)

Btw, the issue under discussion, as I perceive it, was somewhat
different: how to ensure correct decoding of UTF-8 encoded files
(other than *.el) in Emacs source tree _regardless_ of whether the
user in question wants to prefer UTF-8 outside of Emacs tree.  The
best solution we have now is to have a coding cookie in each such
file, and the question is how can that be avoided.

IOW, the solution should IMO be independent of user's preferences.

reply via email to

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