unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to change the default date format?
@ 2019-07-16  4:32 Marcin Borkowski
  2019-07-18  8:56 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Marcin Borkowski @ 2019-07-16  4:32 UTC (permalink / raw)
  To: help-gnu-emacs

Hello everyone,

I used to use my window manager's language settings, which (presumably)
included LC_ALL and/or other LC_* environment variables, and so I had
the "correct" date format in Emacs when I said
`(format-time-string "%x %X" ...)'.

Now that I've changed my wm to a more bare-bones one, how do I change
the locale/langage settings _from within Emacs_, in my init.el?

By reading through the manual, the docstring of `set-locale-environment'
and some trial and error, I found out about
`(set-locale-environment "pl_PL.utf-8")',
after trying "pl" and "pl_PL" as arguments to no avail.  Is this the
preferred method?

TIA,

--
Marcin Borkowski
http://mbork.pl



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to change the default date format?
  2019-07-16  4:32 How to change the default date format? Marcin Borkowski
@ 2019-07-18  8:56 ` Eli Zaretskii
  2019-07-19 19:38   ` Marcin Borkowski
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2019-07-18  8:56 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Marcin Borkowski <mbork@mbork.pl>
> Date: Tue, 16 Jul 2019 06:32:54 +0200
> 
> I used to use my window manager's language settings, which (presumably)
> included LC_ALL and/or other LC_* environment variables, and so I had
> the "correct" date format in Emacs when I said
> `(format-time-string "%x %X" ...)'.
> 
> Now that I've changed my wm to a more bare-bones one, how do I change
> the locale/langage settings _from within Emacs_, in my init.el?
> 
> By reading through the manual, the docstring of `set-locale-environment'
> and some trial and error, I found out about
> `(set-locale-environment "pl_PL.utf-8")',
> after trying "pl" and "pl_PL" as arguments to no avail.  Is this the
> preferred method?

The preferred method is to have the locale set up outside Emacs.  It
is unclear to me why a change in the WM would somehow affect this, but
in any case, you can set the locale in your shell's init/login files,
right?

Doing this from inside Emacs should work, but is not recommended,
because it will create a discrepancy between what Emacs assumes and
what the external programs assume.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: How to change the default date format?
  2019-07-18  8:56 ` Eli Zaretskii
@ 2019-07-19 19:38   ` Marcin Borkowski
  0 siblings, 0 replies; 3+ messages in thread
From: Marcin Borkowski @ 2019-07-19 19:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs


On 2019-07-18, at 10:56, Eli Zaretskii <eliz@gnu.org> wrote:

>> From: Marcin Borkowski <mbork@mbork.pl>
>> Date: Tue, 16 Jul 2019 06:32:54 +0200
>> 
>> I used to use my window manager's language settings, which (presumably)
>> included LC_ALL and/or other LC_* environment variables, and so I had
>> the "correct" date format in Emacs when I said
>> `(format-time-string "%x %X" ...)'.
>> 
>> Now that I've changed my wm to a more bare-bones one, how do I change
>> the locale/langage settings _from within Emacs_, in my init.el?
>> 
>> By reading through the manual, the docstring of `set-locale-environment'
>> and some trial and error, I found out about
>> `(set-locale-environment "pl_PL.utf-8")',
>> after trying "pl" and "pl_PL" as arguments to no avail.  Is this the
>> preferred method?
>
> The preferred method is to have the locale set up outside Emacs.  It
> is unclear to me why a change in the WM would somehow affect this, but
> in any case, you can set the locale in your shell's init/login files,
> right?

Well, my previous WM was in fact part of a desktop environment which
took care of a lot of thing (including locale settings).

> Doing this from inside Emacs should work, but is not recommended,
> because it will create a discrepancy between what Emacs assumes and
> what the external programs assume.

Thanks, that makes sense.

Best,

-- 
Marcin Borkowski
http://mbork.pl



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-19 19:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-16  4:32 How to change the default date format? Marcin Borkowski
2019-07-18  8:56 ` Eli Zaretskii
2019-07-19 19:38   ` Marcin Borkowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).