<<< Date Index >>>     <<< Thread Index >>>

Re: Bug#414828: mutt inserts attribution in wrong charset



Re: Alain Bench 2007-03-26 <20070326134528.GA418@xxxxxxx>
>  On Sunday, March 25, 2007 at 23:12:59 +0200, Christoph Berg wrote:
> 
> > I wonder if $locale shouldn't default to $LC_TIME
> 
>     I fully agree, that would be a good thing, a step in the good
> direction. Naturally users of a mailer expect it to be localized
> following their current locale.

Full ack.

> But changing default $locale value or
> behaviour could break existing muttrcs (those which removed ! from
> $*_format and count on default $locale to get English time).

I had never used $date_format before (at least not in index_format) so
I wasn't sure about which parts are all affected.

It seems we have 3 different locales:
1) the system's/LANG/LC_*
2) $locale
3) C

3 can probably be treated as 1. The main use for 2 on systems
supporting LANG/LC_* seems to be able to use language-specific dates
in attributions. $locale would change the language there, but not the
charset. <pondering> Could we make these 2 parts independent? </p>
Otoh, $locale should not affect the index display when used in that
way.

>     I can imagine 2 ways to do it:
> 
>  -a) Initialise $locale to current locale.
> 
>  -b) Initialise $locale to "", and make this get the current locale
> (instead of skipping setlocale()).
> 
>    (b) would have the advantage to follow runtime environment changes
> (for those using the setenv patch). I'd vote for that.

I'm not sure what the technical difference here is. "" (unset) seems
to have the advantage that "if unset, $LANG will be used" is a bit
more concise than "this variable is initialized to $LANG on mutt
startup". (Modulo environment changes, the effect is probably the
same.)

> > the default date_format does already start with a ! to disable
> > localized timestamps there, and index_format/attribution could be
> > changed as well.
> 
>     Add ! everywhere to reget English by default? Humm... OK, today is
> only a first step, right? Anyway this would also break some existing
> muttrcs (those which set $locale and count on default $index_format to
> get localized time).

I'm more concerned about the defaults for users not having a muttrc.
Those who have one will probably already have tweaked there *_format
variables to the right thing.

As we can probably expect most users to write mail in their own
language, localized defaults would be a good thing. For the others,
adding a handful of ! seems easier than manually setting $locale for
the majority.

>     Conclusion: I'm for it, despite the little problems.
> 
> 
>     Note: See related upstream wish/1158 "persistent locale setting" for
> another aspect of the problem, and for a patch touching the same places
> as alternative (b) above.

On a broader scale, on which kinds of systems do we really need
$charset and $locale inside mutt? Can't we just expect them to set
LC_*? If so, we could modify $locale such that it is only used for
sending mail and leave other localization (mainly dates displayed in
the index) at the current locale. $charset could probably be dropped
completely.

(Or as a "middle" solution, let $charset be as it is, i.e. overriding
LC_CTYPE, and let $locale only affect sent mail. Those users noticing
the difference will be able to configure their system locales
correctly.)

The patch in mutt/1158 implements that (with an extra : modifier),
though I think modified $locale semantics would be easier to
understand.

Christoph
-- 
cb@xxxxxxxx | http://www.df7cb.de/

Attachment: signature.asc
Description: Digital signature