unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: tpeplt <tpeplt@gmail.com>
To: Kepa via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Cc: Kepa <gnu.cognition199@slmails.com>
Subject: Re: Impossible to customize world clock
Date: Mon, 08 Apr 2024 16:45:22 -0400	[thread overview]
Message-ID: <87msq3fusd.fsf@gmail.com> (raw)
In-Reply-To: <171260575677.7.10531721947495332726.303927142@slmails.com> (Kepa via Users list for the's message of "Mon, 8 Apr 2024 21:49:11 +0200")

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	other threads:[~2024-04-08 20:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87msq3fusd.fsf@gmail.com \
    --to=tpeplt@gmail.com \
    --cc=gnu.cognition199@slmails.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).