From 36d4b1454480775205a664c0d5f3677db9296649 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Tue, 30 Oct 2007 21:25:32 +0000 Subject: [PATCH] (display-time-world-list): Test for zoneinfo support. --- lisp/ChangeLog | 4 ++++ lisp/time.el | 14 +++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 125ae99ba06..6c5a112b854 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2007-10-30 Jason Rumney + + * time.el (display-time-world-list): Test for zoneinfo support. + 2007-10-30 Michael Albinus * net/tramp.el (tramp-maybe-open-connection): Set $LC_ALL to "C". diff --git a/lisp/time.el b/lisp/time.el index e2c98910a3b..ef98c6a7819 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -150,9 +150,17 @@ LABEL is a string to display as the label of that TIMEZONE's time." :version "23.1") (defcustom display-time-world-list - (if (memq 'system-type '(gnu/linux ms-dos)) - zoneinfo-style-world-list - legacy-style-world-list) + ;; Determine if zoneinfo style timezones are supported by testing that + ;; America/New York and Europe/London return different timezones. + (let (gmt nyt) + (set-time-zone-rule "America/New York") + (setq nyt (format-time-string "%z")) + (set-time-zone-rule "Europe/London") + (setq gmt (format-time-string "%z")) + (set-time-zone-rule nil) + (if (string-equal nyt gmt) + legacy-style-world-list + zoneinfo-style-world-list)) "Alist of time zones and places for `display-time-world' to display. Each element has the form (TIMEZONE LABEL). TIMEZONE should be in the format supported by `set-time-zone-rule' on -- 2.39.2