-
-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use strftime_l() instead of global setlocale() for %{!...} #3963
Conversation
3064c50
to
5bd8df5
Compare
Hmm... this reply has got quite complicated as I investigated... OK, this seems reasonable; we already use First, the irritation... Looking through the code, there are only a handful of calls to As we need the C locale in quite a few places, I suggest adding it to Fixing Fixing Places of interest:
|
f0cf8a6
to
06af2ae
Compare
Okay, I got rid of all the LC_TIMEs except for the attribution_locale ones (also fixed the test which described "i set TZ=UTC0" as "travis' locale problems") – I think the most sensible way to do it would be to register a notification handler for c_attribution_locale and maintain it as a locale_t, but AFAICT the handlers are for "subsets"? Can I register a global one? Where would I put it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've only had a quick look; I'll have a closer read later.
NeoMutt->sub
is the "global" subset.
Here's a complicated diagram "explaining" the config system
06af2ae
to
f60e869
Compare
|
f60e869
to
6aea400
Compare
rebased |
merged two trivial commits |
I've merged the C locale parts. Thanks! I changed just one thing. |
I not quite decided on the remaining attribution_locale commit. Caching another config variable seems a bit like overkill. |
the obverse is doing the whole freelocale(newlocale(LC_TIME_MASK, "de_EN.UTF-8", duplocale(LC_GLOBAL_LOCALE))) (+ error handling (bad)) dance in every user, for every formatted string so I think "the config changes when the config changes" is much simpler, faster, and easier, than copy-pasting the same code 6 times. i'm actually surprised the solution to changing the config is "wham it in a random global" but I guess having a structured config would be unpalatable to retrofit in C |
…(LC_TIME)ing for it
New ltrace for normal locale-ful format (same as before):
New ltrace for the first locale-free format:
and for subsequent ones: