summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2023-10-15 22:27:17 +0200
committerUlrich Müller <ulm@gentoo.org>2023-10-23 19:59:14 +0200
commit6cfe1e87ed74bdcdaf70fc2958206546455c5db4 (patch)
treea06071372db07bd7c4b9b3b23c9bf975f73fd735
parentYet another fix for the defadvice warning (diff)
downloadebuild-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>
-rw-r--r--ChangeLog3
-rw-r--r--ebuild-mode.el5
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 54fe807..c61a187 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2023-10-15 Ulrich Müller <ulm@gentoo.org>
+ * ebuild-mode.el (ebuild-mode-time-string): Move setting of TZ
+ into the unwind-protect form.
+
* ebuild-mode.el (static-if): New macro, taken from APEL.
(sh-must-be-shell-mode): Use it. This should finally fix the
byte-compile warning for defadvice in Emacs 30.
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)))