summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2023-09-16 20:07:25 +0200
committerUlrich Müller <ulm@gentoo.org>2023-09-16 20:07:25 +0200
commitb3a33b9a8c35214cb18c09590453a7ecc9b9c91c (patch)
tree4c1d9cad50fd5f5d47bd47887dfb1987e7f8b3e8
parentRevert to defadvice for sh-must-be-shell-mode (diff)
downloadebuild-mode-b3a33b9a8c35214cb18c09590453a7ecc9b9c91c.tar.gz
ebuild-mode-b3a33b9a8c35214cb18c09590453a7ecc9b9c91c.tar.bz2
ebuild-mode-b3a33b9a8c35214cb18c09590453a7ecc9b9c91c.zip
Update format-time-string test for newer XEmacs versions
* ebuild-mode.el (ebuild-mode-time-string): Test if format-time-string can accept three arguments. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r--ChangeLog3
-rw-r--r--ebuild-mode.el8
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 68a5be8..7cbdd2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2023-09-16 Ulrich Müller <ulm@gentoo.org>
+ * ebuild-mode.el (ebuild-mode-time-string): Test if
+ format-time-string can accept three arguments.
+
* ebuild-mode.el (sh-must-be-shell-mode): Test if the function is
defined at compile time. This should only be the case for Emacs
versions where defadvice is unobsolete.
diff --git a/ebuild-mode.el b/ebuild-mode.el
index 416758d..816f181 100644
--- a/ebuild-mode.el
+++ b/ebuild-mode.el
@@ -309,9 +309,11 @@ of the elements."
"Use FORMAT-STRING to format the time value TIME.
Calls `format-time-string' (which see) for the UTC time zone.
Compatibility function for XEmacs."
- (if (featurep 'xemacs)
- ;; format-time-string in XEmacs 21.5 can take only two arguments,
- ;; i.e. it doesn't support ZONE
+ (if (and (featurep 'xemacs)
+ (not (function-allows-args 'format-time-string 3)))
+ ;; format-time-string in older XEmacs versions can take only two
+ ;; arguments. Version 21.5.35 still doesn't support a time zone
+ ;; as third argument, but accepts non-nil to mean Universal Time.
(let ((process-environment (copy-sequence process-environment))
(tz (getenv "TZ")))
(setenv "TZ" "UTC")