all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Impossible to customize world clock
@ 2024-04-08 19:49 Kepa via Users list for the GNU Emacs text editor
  2024-04-08 20:45 ` tpeplt
  2024-04-09  2:36 ` Eli Zaretskii
  0 siblings, 2 replies; 16+ messages in thread
From: Kepa via Users list for the GNU Emacs text editor @ 2024-04-08 19:49 UTC (permalink / raw)
  To: help-gnu-emacs

Hi

Today I have tried to customize and use the world clock.

Funny, the default world clocks are ok, but I can't customize it to add 
new zones.


Default list and clocks:

  '(zoneinfo-style-world-list
    '(("America/Los_Angeles" "Seattle")
      ("America/New_York" "New York")
      ("Europe/London" "London")
      ("Europe/Paris" "Paris")
      ("Asia/Calcutta" "Bangalore")
      ("Asia/Tokyo" "Tokyo"))))

Seattle   lunes 08 abril 12:42 PDT
New York  lunes 08 abril 15:42 EDT
London    lunes 08 abril 20:42 BST
Paris     lunes 08 abril 21:42 CDT
Bangalore martes 09 abril 01:12 IST
Tokyo     martes 09 abril 04:42 JST


I add a new one (Europe/Berlin):

  '(zoneinfo-style-world-list
    '(("America/Los_Angeles" "Seattle")
      ("America/New_York" "New York")
      ("Europe/London" "London")
      ("Europe/Paris" "Paris")
      ("Asia/Calcutta" "Bangalore")
      ("Asia/Tokyo" "Tokyo")
      ("Europe/Berlin" "Germany"))))


The world clock doesn't change:

Seattle   lunes 08 abril 12:44 PDT
New York  lunes 08 abril 15:44 EDT
London    lunes 08 abril 20:44 BST
Paris     lunes 08 abril 21:44 CDT
Bangalore martes 09 abril 01:14 IST
Tokyo     martes 09 abril 04:44 JST


Ok, let's customize instead then the "World Clock List":

  '(world-clock-list '(("America/Los_Angeles" "Seattle")))


And world clock is wrong:

Seattle lunes 08 abril 20:48 ric
Germany lunes 08 abril 20:48 ope


OS: Windows 10

GNU Emacs 29.2 (build 2, x86_64-w64-mingw32) of 2024-01-18


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

* Re: Impossible to customize world clock
  2024-04-08 19:49 Impossible to customize world clock Kepa via Users list for the GNU Emacs text editor
@ 2024-04-08 20:45 ` tpeplt
  2024-04-09  4:00   ` Eli Zaretskii
  2024-04-09  2:36 ` Eli Zaretskii
  1 sibling, 1 reply; 16+ messages in thread
From: tpeplt @ 2024-04-08 20:45 UTC (permalink / raw)
  To: Kepa via Users list for the GNU Emacs text editor; +Cc: Kepa

Kepa via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> Hi
>
> Today I have tried to customize and use the world clock.
>
> Funny, the default world clocks are ok, but I can't customize it to
> add new zones.
>
>
> Default list and clocks:
>
>  '(zoneinfo-style-world-list
>    '(("America/Los_Angeles" "Seattle")
>      ("America/New_York" "New York")
>      ("Europe/London" "London")
>      ("Europe/Paris" "Paris")
>      ("Asia/Calcutta" "Bangalore")
>      ("Asia/Tokyo" "Tokyo"))))
>
> Seattle   lunes 08 abril 12:42 PDT
> New York  lunes 08 abril 15:42 EDT
> London    lunes 08 abril 20:42 BST
> Paris     lunes 08 abril 21:42 CDT
> Bangalore martes 09 abril 01:12 IST
> Tokyo     martes 09 abril 04:42 JST
>
>
> I add a new one (Europe/Berlin):
>
>  '(zoneinfo-style-world-list
>    '(("America/Los_Angeles" "Seattle")
>      ("America/New_York" "New York")
>      ("Europe/London" "London")
>      ("Europe/Paris" "Paris")
>      ("Asia/Calcutta" "Bangalore")
>      ("Asia/Tokyo" "Tokyo")
>      ("Europe/Berlin" "Germany"))))
>

Notice that the second string in each pair is a city name, rather than a
country name.  So, your new entry should be: ("Europe/Berlin" "Berlin")

This new entry appears to work as expected.  Try the following:

1. Start Emacs from a shell prompt with no configuration:

   $ emacs -Q

2. In the *scratch* buffer, enter 

   M-x world-clock RET

3. Evaluate the following expression in the *scratch* buffer:

(cl-pushnew '("Europe/Berlin" "Berlin") zoneinfo-style-world-list)

4. Try ‘world-clock’ again:

   M-x world-clock RET

Results:

Berlin    Monday 08 April 22:33 CEST
Seattle   Monday 08 April 13:33 PDT
New York  Monday 08 April 16:33 EDT
London    Monday 08 April 21:33 BST
Paris     Monday 08 April 22:33 CEST
Bangalore Tuesday 09 April 02:03 IST
Tokyo     Tuesday 09 April 05:33 JST

5. If you want to make this permanent, one way to do that is to use
‘customize-option’:

   M-x customize-option RET

   a. At the "Customize variable: " prompt, type zoneinfo-style-world-list RET

   b. In the customize buffer, click on an INS (insert) button at a
      location where you want your new entry to appear (top, middle, or bottom)

   c. In the first String: field, enter the text (no quotes) Europe/Berlin
      In the second String: field, enter the text (no quotes) Berlin

   d. Click on the Apply button.  It will turn dim once it has been accepted.

   e. Check to see that the new value works: M-x world-clock RET

   f. If it doesn’t, then you might want to confirm that the ‘Apply’
      button has been dimmed and click it again if it hasn’t.  If
      ‘world-clock’ works as expected, then click on the ‘Apply and Save’
      button to save the new setting to your Emacs initialization file.

-- 
The lyf so short, the craft so long to lerne.
- Geoffrey Chaucer, The Parliament of Birds.



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

* Re: Impossible to customize world clock
  2024-04-08 19:49 Impossible to customize world clock Kepa via Users list for the GNU Emacs text editor
  2024-04-08 20:45 ` tpeplt
@ 2024-04-09  2:36 ` Eli Zaretskii
  1 sibling, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2024-04-09  2:36 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Mon, 8 Apr 2024 21:49:11 +0200
> From:  Kepa via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
> 
> Today I have tried to customize and use the world clock.
> 
> Funny, the default world clocks are ok, but I can't customize it to add 
> new zones.
> 
> 
> Default list and clocks:
> 
>   '(zoneinfo-style-world-list
>     '(("America/Los_Angeles" "Seattle")
>       ("America/New_York" "New York")
>       ("Europe/London" "London")
>       ("Europe/Paris" "Paris")
>       ("Asia/Calcutta" "Bangalore")
>       ("Asia/Tokyo" "Tokyo"))))
> 
> Seattle   lunes 08 abril 12:42 PDT
> New York  lunes 08 abril 15:42 EDT
> London    lunes 08 abril 20:42 BST
> Paris     lunes 08 abril 21:42 CDT
> Bangalore martes 09 abril 01:12 IST
> Tokyo     martes 09 abril 04:42 JST
> 
> 
> I add a new one (Europe/Berlin):
> 
>   '(zoneinfo-style-world-list
>     '(("America/Los_Angeles" "Seattle")
>       ("America/New_York" "New York")
>       ("Europe/London" "London")
>       ("Europe/Paris" "Paris")
>       ("Asia/Calcutta" "Bangalore")
>       ("Asia/Tokyo" "Tokyo")
>       ("Europe/Berlin" "Germany"))))
> 
> 
> The world clock doesn't change:
> 
> Seattle   lunes 08 abril 12:44 PDT
> New York  lunes 08 abril 15:44 EDT
> London    lunes 08 abril 20:44 BST
> Paris     lunes 08 abril 21:44 CDT
> Bangalore martes 09 abril 01:14 IST
> Tokyo     martes 09 abril 04:44 JST

You are on MS-Windows, where you need to customize
legacy-style-world-list instead.

> Ok, let's customize instead then the "World Clock List":
> 
>   '(world-clock-list '(("America/Los_Angeles" "Seattle")))
> 
> 
> And world clock is wrong:
> 
> Seattle lunes 08 abril 20:48 ric
> Germany lunes 08 abril 20:48 ope

Emacs on MS-Windows doesn't support timezone specification of the form
"America/Los_Angeles", because the Windows runtime libraries don't
support that.  You need to use the legacy format instead, as in
("PST8PDT" "Seattle").  See the doc string of legacy-style-world-list
for more details.



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

* Re: Impossible to customize world clock
  2024-04-08 20:45 ` tpeplt
@ 2024-04-09  4:00   ` Eli Zaretskii
  2024-04-09 13:46     ` Stefan Monnier via Users list for the GNU Emacs text editor
  2024-04-09 13:52     ` tpeplt
  0 siblings, 2 replies; 16+ messages in thread
From: Eli Zaretskii @ 2024-04-09  4:00 UTC (permalink / raw)
  To: help-gnu-emacs

> From: tpeplt <tpeplt@gmail.com>
> Cc: Kepa <gnu.cognition199@slmails.com>
> Date: Mon, 08 Apr 2024 16:45:22 -0400
> 
> Kepa via Users list for the GNU Emacs text editor
> <help-gnu-emacs@gnu.org> writes:
> 
> > I add a new one (Europe/Berlin):
> >
> >  '(zoneinfo-style-world-list
> >    '(("America/Los_Angeles" "Seattle")
> >      ("America/New_York" "New York")
> >      ("Europe/London" "London")
> >      ("Europe/Paris" "Paris")
> >      ("Asia/Calcutta" "Bangalore")
> >      ("Asia/Tokyo" "Tokyo")
> >      ("Europe/Berlin" "Germany"))))
> >
> 
> Notice that the second string in each pair is a city name, rather than a
> country name.  So, your new entry should be: ("Europe/Berlin" "Berlin")

No, the second string is just a label, something you want to be shown
as the name of the corresponding time zone.  It can be anything, not
necessarily the name of a city.  See the doc string for more detail.

> This new entry appears to work as expected.  Try the following:
> 
> 1. Start Emacs from a shell prompt with no configuration:
> 
>    $ emacs -Q
> 
> 2. In the *scratch* buffer, enter 
> 
>    M-x world-clock RET
> 
> 3. Evaluate the following expression in the *scratch* buffer:
> 
> (cl-pushnew '("Europe/Berlin" "Berlin") zoneinfo-style-world-list)

This signals an error:

  error: (void-function cl-pushnew)

> 4. Try ‘world-clock’ again:
> 
>    M-x world-clock RET
> 
> Results:
> 
> Berlin    Monday 08 April 22:33 CEST
> Seattle   Monday 08 April 13:33 PDT
> New York  Monday 08 April 16:33 EDT
> London    Monday 08 April 21:33 BST
> Paris     Monday 08 April 22:33 CEST
> Bangalore Tuesday 09 April 02:03 IST
> Tokyo     Tuesday 09 April 05:33 JST

If this works for you, you are not on MS-Windows, like the OP.

> 5. If you want to make this permanent, one way to do that is to use
> ‘customize-option’:
> 
>    M-x customize-option RET
> 
>    a. At the "Customize variable: " prompt, type zoneinfo-style-world-list RET

On MS-Windows, one should customize legacy-style-world-list instead.



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

* Re: Impossible to customize world clock
  2024-04-09  4:00   ` Eli Zaretskii
@ 2024-04-09 13:46     ` Stefan Monnier via Users list for the GNU Emacs text editor
  2024-04-09 14:32       ` Eli Zaretskii
  2024-04-09 13:52     ` tpeplt
  1 sibling, 1 reply; 16+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-04-09 13:46 UTC (permalink / raw)
  To: help-gnu-emacs

> On MS-Windows, one should customize legacy-style-world-list instead.

Hmm... it's too bad that in order to automatically make it work on both
MS-Windows and other systems (by automatically choosing which var to
use) we end up silently ignoring the user's config when the user isn't
aware of this mechanism.

Maybe we should have chosen for `world-clock-list` a format like

    ("London" "Europe/London" "GMT0BST")


- Stefan




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

* Re: Impossible to customize world clock
  2024-04-09  4:00   ` Eli Zaretskii
  2024-04-09 13:46     ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2024-04-09 13:52     ` tpeplt
  1 sibling, 0 replies; 16+ messages in thread
From: tpeplt @ 2024-04-09 13:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>> 
>> Notice that the second string in each pair is a city name, rather than a
>> country name.  So, your new entry should be: ("Europe/Berlin" "Berlin")
>
> No, the second string is just a label, something you want to be shown
> as the name of the corresponding time zone.  It can be anything, not
> necessarily the name of a city.  See the doc string for more detail.
>
>> This new entry appears to work as expected.  Try the following:
>> 
>> 1. Start Emacs from a shell prompt with no configuration:
>> 
>>    $ emacs -Q
>> 
>> 2. In the *scratch* buffer, enter 
>> 
>>    M-x world-clock RET
>> 
>> 3. Evaluate the following expression in the *scratch* buffer:
>> 
>> (cl-pushnew '("Europe/Berlin" "Berlin") zoneinfo-style-world-list)
>
> This signals an error:
>
>   error: (void-function cl-pushnew)
>

Yes, it does signal an error.  It did not when I wrote the reply.  After
reproducing the problem, I was able to evaluate the ‘cl-pushnew’
expression successfully by repeating a mistake I likely made: typing
‘-q’ where I meant to type ‘-Q’.  With ‘emacs -q’, the expression can be
evaluated without signaling an error.

>> 4. Try ‘world-clock’ again:
>> 
>>    M-x world-clock RET
>> 
>> Results:
>> 
>> Berlin    Monday 08 April 22:33 CEST
>> Seattle   Monday 08 April 13:33 PDT
>> New York  Monday 08 April 16:33 EDT
>> London    Monday 08 April 21:33 BST
>> Paris     Monday 08 April 22:33 CEST
>> Bangalore Tuesday 09 April 02:03 IST
>> Tokyo     Tuesday 09 April 05:33 JST
>
> If this works for you, you are not on MS-Windows, like the OP.
>

Yes, I did not even consider that there was an operating-system
requirement because neither ‘world-clock’ nor
‘zoneinfo-style-world-list’ mentions a o/s requirement.  The docstring
for ‘world-clock-list’ does provide some instruction, but it described a
problem (an o/s requirement) that did not occur.  Thanks for the
clarification.

-- 
The lyf so short, the craft so long to lerne.
- Geoffrey Chaucer, The Parliament of Birds.



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

* Re: Impossible to customize world clock
  2024-04-09 13:46     ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2024-04-09 14:32       ` Eli Zaretskii
  2024-04-09 15:12         ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2024-04-09 14:32 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Tue, 09 Apr 2024 09:46:21 -0400
> From:  Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
> 
> > On MS-Windows, one should customize legacy-style-world-list instead.
> 
> Hmm... it's too bad that in order to automatically make it work on both
> MS-Windows and other systems (by automatically choosing which var to
> use) we end up silently ignoring the user's config when the user isn't
> aware of this mechanism.
> 
> Maybe we should have chosen for `world-clock-list` a format like
> 
>     ("London" "Europe/London" "GMT0BST")

I'm not sure it will work reliably, since the MS-Windows runtime
supports a very small number of zones via those legacy specifiers,
nowhere near the number of zones you will see in the zoneinfo
directory of a typical Posix host.

The more capable modern Windows time zones are arranged differently,
not by city (with a few exceptions), and have different names.  The
conversion between the Posix time zones and Windows time zones is thus
not trivial (but patches for doing that will be most welcome).  As
long as we go only by Posix names, I don't see how we can have a
single structure with both Posix and Windows descriptors.



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

* Re: Impossible to customize world clock
  2024-04-09 14:32       ` Eli Zaretskii
@ 2024-04-09 15:12         ` Stefan Monnier via Users list for the GNU Emacs text editor
  2024-04-09 15:28           ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-04-09 15:12 UTC (permalink / raw)
  To: help-gnu-emacs

>> Hmm... it's too bad that in order to automatically make it work on both
>> MS-Windows and other systems (by automatically choosing which var to
>> use) we end up silently ignoring the user's config when the user isn't
>> aware of this mechanism.
>> 
>> Maybe we should have chosen for `world-clock-list` a format like
>> 
>>     ("London" "Europe/London" "GMT0BST")
>
> I'm not sure it will work reliably, since the MS-Windows runtime
> supports a very small number of zones via those legacy specifiers,
> nowhere near the number of zones you will see in the zoneinfo
> directory of a typical Posix host.

Oh, it wouldn't make any difference to what is supported and what is
not: on MS-Windows we'd use the 3rd element of the lists, and on other
systems we'd use the 2nd element of the list.  The purpose would be only
to have a single variable, so the users are less likely to update one
without knowing it's not the one they're using.


        Stefan




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

* Re: Impossible to customize world clock
  2024-04-09 15:12         ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2024-04-09 15:28           ` Eli Zaretskii
  2024-04-09 16:52             ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2024-04-09 15:28 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Tue, 09 Apr 2024 11:12:42 -0400
> From:  Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
> 
> >> Hmm... it's too bad that in order to automatically make it work on both
> >> MS-Windows and other systems (by automatically choosing which var to
> >> use) we end up silently ignoring the user's config when the user isn't
> >> aware of this mechanism.
> >> 
> >> Maybe we should have chosen for `world-clock-list` a format like
> >> 
> >>     ("London" "Europe/London" "GMT0BST")
> >
> > I'm not sure it will work reliably, since the MS-Windows runtime
> > supports a very small number of zones via those legacy specifiers,
> > nowhere near the number of zones you will see in the zoneinfo
> > directory of a typical Posix host.
> 
> Oh, it wouldn't make any difference to what is supported and what is
> not: on MS-Windows we'd use the 3rd element of the lists, and on other
> systems we'd use the 2nd element of the list.  The purpose would be only
> to have a single variable, so the users are less likely to update one
> without knowing it's not the one they're using.

Then maybe I'm missing something because I don't understand how would
that help the OP.  He said:

> I add a new one (Europe/Berlin):
> 
>   '(zoneinfo-style-world-list
>     '(("America/Los_Angeles" "Seattle")
>       ("America/New_York" "New York")
>       ("Europe/London" "London")
>       ("Europe/Paris" "Paris")
>       ("Asia/Calcutta" "Bangalore")
>       ("Asia/Tokyo" "Tokyo")
>       ("Europe/Berlin" "Germany"))))

How would your suggestion help him to "add Europe/Berlin"?



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

* Re: Impossible to customize world clock
  2024-04-09 15:28           ` Eli Zaretskii
@ 2024-04-09 16:52             ` Stefan Monnier via Users list for the GNU Emacs text editor
  2024-04-09 18:34               ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-04-09 16:52 UTC (permalink / raw)
  To: help-gnu-emacs

>> >> Maybe we should have chosen for `world-clock-list` a format like
>> >> 
>> >>     ("London" "Europe/London" "GMT0BST")
>> >
>> > I'm not sure it will work reliably, since the MS-Windows runtime
>> > supports a very small number of zones via those legacy specifiers,
>> > nowhere near the number of zones you will see in the zoneinfo
>> > directory of a typical Posix host.
>> 
>> Oh, it wouldn't make any difference to what is supported and what is
>> not: on MS-Windows we'd use the 3rd element of the lists, and on other
>> systems we'd use the 2nd element of the list.  The purpose would be only
>> to have a single variable, so the users are less likely to update one
>> without knowing it's not the one they're using.
>
> Then maybe I'm missing something because I don't understand how would
> that help the OP.  He said:
>
>> I add a new one (Europe/Berlin):
>> 
>>   '(zoneinfo-style-world-list
>>     '(("America/Los_Angeles" "Seattle")
>>       ("America/New_York" "New York")
>>       ("Europe/London" "London")
>>       ("Europe/Paris" "Paris")
>>       ("Asia/Calcutta" "Bangalore")
>>       ("Asia/Tokyo" "Tokyo")
>>       ("Europe/Berlin" "Germany"))))
>
> How would your suggestion help him to "add Europe/Berlin"?

When looking how to add Berlin, he'd search for the vars to change and
would find `world-clock-list` with a list of elements of the form (NAME
OTHERNAME FUNNYNAME), so it would (hopefully) naturally make him wonder
which part to change.  In contrast with the current situation he
stumbled upon `zoneinfo-world-clock-list` and was stumped because it
made no difference although his change was "correct".

Maybe a first way to avoid the problem would be simply to put different
places in the default value of `zoneinfo-world-clock-list` than in
`legacy-world-clock-list`, so that it'd be more obvious which is the one
currently in use.


        Stefan




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

* Re: Impossible to customize world clock
  2024-04-09 16:52             ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2024-04-09 18:34               ` Eli Zaretskii
  2024-04-09 18:41                 ` Emanuel Berg
  2024-04-10  2:48                 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 16+ messages in thread
From: Eli Zaretskii @ 2024-04-09 18:34 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Tue, 09 Apr 2024 12:52:21 -0400
> From:  Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
> 
> > Then maybe I'm missing something because I don't understand how would
> > that help the OP.  He said:
> >
> >> I add a new one (Europe/Berlin):
> >> 
> >>   '(zoneinfo-style-world-list
> >>     '(("America/Los_Angeles" "Seattle")
> >>       ("America/New_York" "New York")
> >>       ("Europe/London" "London")
> >>       ("Europe/Paris" "Paris")
> >>       ("Asia/Calcutta" "Bangalore")
> >>       ("Asia/Tokyo" "Tokyo")
> >>       ("Europe/Berlin" "Germany"))))
> >
> > How would your suggestion help him to "add Europe/Berlin"?
> 
> When looking how to add Berlin, he'd search for the vars to change and
> would find `world-clock-list` with a list of elements of the form (NAME
> OTHERNAME FUNNYNAME), so it would (hopefully) naturally make him wonder
> which part to change.  In contrast with the current situation he
> stumbled upon `zoneinfo-world-clock-list` and was stumped because it
> made no difference although his change was "correct".

That's not what I meant.  What I meant was how would users know which
XXXnYYY string to use for FUNNYNAME that will have the effect of
showing the time in Berlin, like "Europe/Berlin" does?

> Maybe a first way to avoid the problem would be simply to put different
> places in the default value of `zoneinfo-world-clock-list` than in
> `legacy-world-clock-list`, so that it'd be more obvious which is the one
> currently in use.

The idea behind the current values was to produce (almost) the same
display on all systems with the default values.  Your suggestion will
necessarily cause bug reports of the "I see this display on GNU/Linux,
but that display on Windows" kind.

If the only issue is to make sure users know what to customize, we
could clarify that in the doc strings.  That'd probably be more
efficient and will not change the default behavior.



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

* Re: Impossible to customize world clock
  2024-04-09 18:34               ` Eli Zaretskii
@ 2024-04-09 18:41                 ` Emanuel Berg
  2024-04-10  2:32                   ` Eli Zaretskii
  2024-04-10  2:48                 ` Stefan Monnier via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 16+ messages in thread
From: Emanuel Berg @ 2024-04-09 18:41 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii wrote:

>>>> I add a new one (Europe/Berlin):
>>>> 
>>>>   '(zoneinfo-style-world-list
>>>>     '(("America/Los_Angeles" "Seattle")
>>>>       ("America/New_York" "New York")
>>>>       ("Europe/London" "London")
>>>>       ("Europe/Paris" "Paris")
>>>>       ("Asia/Calcutta" "Bangalore")
>>>>       ("Asia/Tokyo" "Tokyo")
>>>>       ("Europe/Berlin" "Germany"))))
>>>
>>> How would your suggestion help him to "add Europe/Berlin"?
>> 
>> When looking how to add Berlin, he'd search for the vars to
>> change and would find `world-clock-list` [...]
>
> That's not what I meant.

Guys, what seems to be the problem?

The clock can be setup pretty straightforwardly, for example
like this:

;;; -*- lexical-binding: t -*-
;;
;; this file:
;;   https://dataswamp.org/~incal/emacs-init/world-clock-incal.el

(require 'time)

(defalias 'wc #'world-clock)

(setq world-clock-time-format " %F  %R  UTC%z %Z")

(define-key world-clock-mode-map "u" (lambda () (interactive)
                                       (world-clock-update) ))

(setq zoneinfo-style-world-list
  (list
   '("America/Los_Angeles" "Los Angeles")
   '("America/New_York"    "New York")
   '("Europe/London"       "London")
   '("Europe/Paris"        "Paris")
   '("Europe/Berlin"       "Berlin")
   '("Europe/Stockholm"    "Stockholm")
   '("Europe/Moscow"       "Moscow")
   '("Asia/Shanghai"       "Shanghai")
   ))

(provide 'world-clock-incal)

-- 
underground experts united
https://dataswamp.org/~incal




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

* Re: Impossible to customize world clock
  2024-04-09 18:41                 ` Emanuel Berg
@ 2024-04-10  2:32                   ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2024-04-10  2:32 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Emanuel Berg <incal@dataswamp.org>
> Date: Tue, 09 Apr 2024 20:41:20 +0200
> 
> Eli Zaretskii wrote:
> 
> >>>> I add a new one (Europe/Berlin):
> >>>> 
> >>>>   '(zoneinfo-style-world-list
> >>>>     '(("America/Los_Angeles" "Seattle")
> >>>>       ("America/New_York" "New York")
> >>>>       ("Europe/London" "London")
> >>>>       ("Europe/Paris" "Paris")
> >>>>       ("Asia/Calcutta" "Bangalore")
> >>>>       ("Asia/Tokyo" "Tokyo")
> >>>>       ("Europe/Berlin" "Germany"))))
> >>>
> >>> How would your suggestion help him to "add Europe/Berlin"?
> >> 
> >> When looking how to add Berlin, he'd search for the vars to
> >> change and would find `world-clock-list` [...]
> >
> > That's not what I meant.
> 
> Guys, what seems to be the problem?
> 
> The clock can be setup pretty straightforwardly, for example
> like this:

I guess you haven't read the thread, because you are doing the same
mistake the OP did.



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

* Re: Impossible to customize world clock
  2024-04-09 18:34               ` Eli Zaretskii
  2024-04-09 18:41                 ` Emanuel Berg
@ 2024-04-10  2:48                 ` Stefan Monnier via Users list for the GNU Emacs text editor
  2024-04-10 13:53                   ` Eli Zaretskii
  1 sibling, 1 reply; 16+ messages in thread
From: Stefan Monnier via Users list for the GNU Emacs text editor @ 2024-04-10  2:48 UTC (permalink / raw)
  To: help-gnu-emacs

>> When looking how to add Berlin, he'd search for the vars to change and
>> would find `world-clock-list` with a list of elements of the form (NAME
>> OTHERNAME FUNNYNAME), so it would (hopefully) naturally make him wonder
>> which part to change.  In contrast with the current situation he
>> stumbled upon `zoneinfo-world-clock-list` and was stumped because it
>> made no difference although his change was "correct".
>
> That's not what I meant.  What I meant was how would users know which
> XXXnYYY string to use for FUNNYNAME that will have the effect of
> showing the time in Berlin, like "Europe/Berlin" does?

I'm not trying to fix this problem.  I'm just trying to make it easier
for the users to know which problem they need to solve.
With the representation I'm suggesting, they'd have three problems to
solve:

1- Find the variable.  [ apparently the OP would have solved this
   problem since he found `zoneinfo-world-clock-list`).  ]
2- Figure out which of OTHERNAME or FUNNYNAME (or both) they need to set.
   [ This is the problem which the OP didn't know he had to solve
     because the current representation made it not obvious enough.  ]
3- Figure out which FUNNYNAME they should use.
   [ This is the harder problem that needs to be solved in all cases.  ]

> If the only issue is to make sure users know what to customize, we
> could clarify that in the doc strings.  That'd probably be more
> efficient and will not change the default behavior.

You're probably right.


        Stefan




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

* Re: Impossible to customize world clock
  2024-04-10  2:48                 ` Stefan Monnier via Users list for the GNU Emacs text editor
@ 2024-04-10 13:53                   ` Eli Zaretskii
  0 siblings, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2024-04-10 13:53 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Tue, 09 Apr 2024 22:48:14 -0400
> From:  Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
> 
> > If the only issue is to make sure users know what to customize, we
> > could clarify that in the doc strings.  That'd probably be more
> > efficient and will not change the default behavior.
> 
> You're probably right.

Now done.



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

* Re: Impossible to customize world clock
@ 2024-04-13 12:15 Kepa via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 16+ messages in thread
From: Kepa via Users list for the GNU Emacs text editor @ 2024-04-13 12:15 UTC (permalink / raw)
  To: Kepa via Users list for the GNU Emacs text editor

From:     Eli Zaretskii
Subject:     Re: Impossible to customize world clock
Date:     Tue, 09 Apr 2024 05:36:57 +0300

 > Emacs on MS-Windows doesn't support timezone specification of the form
 > "America/Los_Angeles", because the Windows runtime libraries don't
 > support that.  You need to use the legacy format instead, as in
 > ("PST8PDT" "Seattle").  See the doc string of legacy-style-world-list
 > for more details.

Thanks, Eli

I can see there are:

Legacy Style World List
World Clock List
Zoneinfo Style World List


The world clock list is what must be filled, using one of the two other 
formats, that would be just examples?

Best regards


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

end of thread, other threads:[~2024-04-13 12:15 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-08 19:49 Impossible to customize world clock Kepa via Users list for the GNU Emacs text editor
2024-04-08 20:45 ` tpeplt
2024-04-09  4:00   ` Eli Zaretskii
2024-04-09 13:46     ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-04-09 14:32       ` Eli Zaretskii
2024-04-09 15:12         ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-04-09 15:28           ` Eli Zaretskii
2024-04-09 16:52             ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-04-09 18:34               ` Eli Zaretskii
2024-04-09 18:41                 ` Emanuel Berg
2024-04-10  2:32                   ` Eli Zaretskii
2024-04-10  2:48                 ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-04-10 13:53                   ` Eli Zaretskii
2024-04-09 13:52     ` tpeplt
2024-04-09  2:36 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2024-04-13 12:15 Kepa via Users list for the GNU Emacs text editor

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.