diff options
author | Ulrich Müller <ulm@gentoo.org> | 2023-10-15 22:27:17 +0200 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2023-10-23 19:59:14 +0200 |
commit | 6cfe1e87ed74bdcdaf70fc2958206546455c5db4 (patch) | |
tree | a06071372db07bd7c4b9b3b23c9bf975f73fd735 /ebuild-mode.el | |
parent | Yet another fix for the defadvice warning (diff) | |
download | ebuild-mode-6cfe1e87ed74bdcdaf70fc2958206546455c5db4.tar.gz ebuild-mode-6cfe1e87ed74bdcdaf70fc2958206546455c5db4.tar.bz2 ebuild-mode-6cfe1e87ed74bdcdaf70fc2958206546455c5db4.zip |
Set the timezone inside unwind-protect
* ebuild-mode.el (ebuild-mode-time-string): Move setting of TZ
into the unwind-protect form.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'ebuild-mode.el')
-rw-r--r-- | ebuild-mode.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ebuild-mode.el b/ebuild-mode.el index 05fb011..5908b7f 100644 --- a/ebuild-mode.el +++ b/ebuild-mode.el @@ -316,9 +316,10 @@ Compatibility function for XEmacs." ;; as third argument, but accepts non-nil to mean Universal Time. (let ((process-environment (copy-sequence process-environment)) (tz (getenv "TZ"))) - (setenv "TZ" "UTC") (unwind-protect - (format-time-string format-string time) + (progn + (setenv "TZ" "UTC") + (format-time-string format-string time)) ;; This is needed because setenv handles TZ specially. ;; So, restoring the environment is not enough. (setenv "TZ" tz))) |