summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNic Ferrier <nferrier@ferrier.me.uk>2014-06-26 22:00:56 +0100
committerNic Ferrier <nferrier@ferrier.me.uk>2014-06-26 22:00:56 +0100
commitb663132304ddd343d97ae384ab4fb2f77028e6f5 (patch)
tree5612e1fa3b02a7bec5b1fc94428d96fc1fe43194
parentd9d962a94da73e7b1c32d10d06d628a724921507 (diff)
back to sets with unwind-protect, doesn't work another way
-rw-r--r--world-time-mode.el10
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.