diff options
author | Nic Ferrier <nferrier@ferrier.me.uk> | 2014-06-26 22:00:56 +0100 |
---|---|---|
committer | Nic Ferrier <nferrier@ferrier.me.uk> | 2014-06-26 22:00:56 +0100 |
commit | b663132304ddd343d97ae384ab4fb2f77028e6f5 (patch) | |
tree | 5612e1fa3b02a7bec5b1fc94428d96fc1fe43194 | |
parent | d9d962a94da73e7b1c32d10d06d628a724921507 (diff) |
back to sets with unwind-protect, doesn't work another way
-rw-r--r-- | world-time-mode.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/world-time-mode.el b/world-time-mode.el index 7836b90..03a637d 100644 --- a/world-time-mode.el +++ b/world-time-mode.el @@ -32,11 +32,15 @@ (apply 'vector (mapcar (lambda (zone) - (let ((process-environment (cons (concat "TZ=" (car zone)) - process-environment))) - (list (format-time-string "%R %Z" this-time)))) + (let ((original (getenv "TZ"))) + (unwind-protect + (progn + (setenv "TZ" (car zone)) + (list (format-time-string "%R %Z" this-time))) + (setenv "TZ" original)))) display-time-world-list))) + (defun world-time/table-entrys () "Make the entry table for the list. |