bug#81582: 32.0.50; gnus-search: with-locale-environment for a month name breaks tty display

Sean Whitton <[email protected]>
Newsgroups gmane.emacs.bugs
Message-ID <[email protected]>
Colin McLear [08/Aug  4:58pm -04] wrote:
> Suggested fix:
>
> `format-time-string` consults `system-time-locale`, which sets LC_TIME for
> that one call and touches no display state. In `gnus-search-imap-handle-date`:
>
>     (let ((system-time-locale "C"))
>       (format-time-string "%e-%b-%Y" (encode-time 0 0 0 dday dmonth dyear)))
>
> in place of the `with-locale-environment` wrapper.
>
> I compared the two forms on three dates, including the `%e` space padding for
> single-digit days. Output is identical, leading space included:
>
>     (1 6 2026)    both => " 1-Jun-2026"
>     (15 12 2025)  both => "15-Dec-2025"
>     (3 3 2026)    both => " 3-Mar-2026"

SGTM, would you like to turn this into a patch we can install?

It'll probably be small enough to install without copyright assignment,
but to make it easier to contribute to GNU Emacs in the future, would
you be willing to start that process?

> gnus-search.el is the one caller of `with-locale-environment` I am
> sure of.  I definitely have not audited the tree for others, so there
> may well be more, and the same reasoning would apply anywhere the
> macro is used only to influence time formatting.

There's one other but it's only in a test, so it's fine, I think.

Adding Eric just in case he sees a problem.

-- 
Sean Whitton
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.