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: Emanuel Berg
Subject: Re: Impossible to customize world clock
Date: Tue, 09 Apr 2024 20:41:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

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




reply via email to

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