help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Impossible to customize world clock


From: tpeplt
Subject: Re: Impossible to customize world clock
Date: Mon, 08 Apr 2024 16:45:22 -0400
User-agent: Gnus/5.13 (Gnus v5.13)

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]