diff options
author | 2023-09-16 20:07:25 +0200 | |
---|---|---|
committer | 2023-09-16 20:07:25 +0200 | |
commit | b3a33b9a8c35214cb18c09590453a7ecc9b9c91c (patch) | |
tree | 4c1d9cad50fd5f5d47bd47887dfb1987e7f8b3e8 | |
parent | Revert to defadvice for sh-must-be-shell-mode (diff) | |
download | ebuild-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-- | ChangeLog | 3 | ||||
-rw-r--r-- | ebuild-mode.el | 8 |
2 files changed, 8 insertions, 3 deletions
@@ -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") |