all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Passing time zones
@ 2025-02-05  0:55 Heime via Users list for the GNU Emacs text editor
  2025-02-05 10:18 ` Joel Reicher
  2025-02-05 10:19 ` Joel Reicher
  0 siblings, 2 replies; 5+ messages in thread
From: Heime via Users list for the GNU Emacs text editor @ 2025-02-05  0:55 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

I need some ideas on how I can have the user input the time zone name.
The list has cons cells with the car having a time-zone label, while the
cdr has a name for the TZ Environment Variable.  The user will just select
the time-zone label.

  (interactive
    (list
      (read-string " Clock Name: " "World Clock")

      (let ( (cseq '(("UTC"         . "UTC")
                     ("New York"    . "America/New_York")
                     ("London"      . "Europe/London")
                     ("Tokyo"       . "Asia/Tokyo")
                     ("Sydney"      . "Australia/Sydney")
                     ("Berlin"      . "Europe/Berlin")
                     ("Los Angeles" . "America/Los_Angeles")
                     ("Kolkata"     . "Asia/Kolkata"))) )
        (completing-read " Time Zone: " cseq nil t))

      (let ( (cseq '("red" "green" "blue" "orange" "purple"
                     "cyan" "magenta" "yellow")) )
        (completing-read " Colour: " cseq nil t))))






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

* Re: Passing time zones
  2025-02-05  0:55 Passing time zones Heime via Users list for the GNU Emacs text editor
@ 2025-02-05 10:18 ` Joel Reicher
  2025-02-05 10:19 ` Joel Reicher
  1 sibling, 0 replies; 5+ messages in thread
From: Joel Reicher @ 2025-02-05 10:18 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor; +Cc: Heime

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

> I need some ideas on how I can have the user input the time zone 
> name.  The list has cons cells with the car having a time-zone 
> label, while the cdr has a name for the TZ Environment Variable. 
> The user will just select the time-zone label.

I would recommend having a look at the documentation for the 
variables listed in the customisation group `world-clock'. I think 
it solves exactly the same problem, and if I'm right you would 
benefit from understanding the work of all the people who have 
done this before you.

Regards,

        - Joel



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

* Re: Passing time zones
  2025-02-05  0:55 Passing time zones Heime via Users list for the GNU Emacs text editor
  2025-02-05 10:18 ` Joel Reicher
@ 2025-02-05 10:19 ` Joel Reicher
  2025-02-05 12:00   ` Heime via Users list for the GNU Emacs text editor
  1 sibling, 1 reply; 5+ messages in thread
From: Joel Reicher @ 2025-02-05 10:19 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor; +Cc: Heime

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

> I need some ideas on how I can have the user input the time zone 
> name.  The list has cons cells with the car having a time-zone 
> label, while the cdr has a name for the TZ Environment Variable. 
> The user will just select the time-zone label.

I would recommend having a look at the documentation for the 
variables listed in the customisation group `world-clock'. I think 
it solves exactly the same problem, and if I'm right you would 
benefit from understanding the work of all the people who have 
done this before you.

Regards,

        - Joel



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

* Re: Passing time zones
  2025-02-05 10:19 ` Joel Reicher
@ 2025-02-05 12:00   ` Heime via Users list for the GNU Emacs text editor
  2025-02-05 13:18     ` Heime via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 5+ messages in thread
From: Heime via Users list for the GNU Emacs text editor @ 2025-02-05 12:00 UTC (permalink / raw)
  To: Joel Reicher; +Cc: Heime via Users list for the GNU Emacs text editor






Sent with Proton Mail secure email.

On Wednesday, February 5th, 2025 at 10:19 PM, Joel Reicher <joel.reicher@gmail.com> wrote:

> Heime via Users list for the GNU Emacs text editor
> help-gnu-emacs@gnu.org writes:
> 
> > I need some ideas on how I can have the user input the time zone
> > name. The list has cons cells with the car having a time-zone
> > label, while the cdr has a name for the TZ Environment Variable.
> > The user will just select the time-zone label.
> 
> 
> I would recommend having a look at the documentation for the
> variables listed in the customisation group `world-clock'. I think
> it solves exactly the same problem, and if I'm right you would
> benefit from understanding the work of all the people who have
> done this before you.
> 
> Regards,> - Joel

I have solved the problem by using 

 (completing-read " Time Zone: " (mapcar 'car cseq) nil t)






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

* Re: Passing time zones
  2025-02-05 12:00   ` Heime via Users list for the GNU Emacs text editor
@ 2025-02-05 13:18     ` Heime via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 5+ messages in thread
From: Heime via Users list for the GNU Emacs text editor @ 2025-02-05 13:18 UTC (permalink / raw)
  To: Heime; +Cc: Joel Reicher, Heime via Users list for the GNU Emacs text editor






Sent with Proton Mail secure email.

On Thursday, February 6th, 2025 at 12:00 AM, Heime via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:

> 
> 
> 
> 
> 
> Sent with Proton Mail secure email.
> 
> 
> On Wednesday, February 5th, 2025 at 10:19 PM, Joel Reicher joel.reicher@gmail.com wrote:
> 
> > Heime via Users list for the GNU Emacs text editor
> > help-gnu-emacs@gnu.org writes:
> > 
> > > I need some ideas on how I can have the user input the time zone
> > > name. The list has cons cells with the car having a time-zone
> > > label, while the cdr has a name for the TZ Environment Variable.
> > > The user will just select the time-zone label.
> > 
> > I would recommend having a look at the documentation for the
> > variables listed in the customisation group `world-clock'. I think
> > it solves exactly the same problem, and if I'm right you would
> > benefit from understanding the work of all the people who have
> > done this before you.
> > 
> > Regards,> - Joel
 

Continuing with your suggestion, I encountered
 
Zoneinfo Style World List 
   Alist of zoneinfo-style time zones and places for ‘world-clock’.
   Each element has the form (TIMEZONE LABEL).
   TIMEZONE should be a string of the form AREA/LOCATION.

Would users prefer seeing AREA/LOCATION or just LOCATION?
Area is the name of a region -- a continent or ocean.

 
> I have solved the problem by using
> 
> (completing-read " Time Zone: " (mapcar 'car cseq) nil t)





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

end of thread, other threads:[~2025-02-05 13:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-05  0:55 Passing time zones Heime via Users list for the GNU Emacs text editor
2025-02-05 10:18 ` Joel Reicher
2025-02-05 10:19 ` Joel Reicher
2025-02-05 12:00   ` Heime via Users list for the GNU Emacs text editor
2025-02-05 13:18     ` Heime 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.