From b3a33b9a8c35214cb18c09590453a7ecc9b9c91c Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Sat, 16 Sep 2023 20:07:25 +0200 Subject: Update format-time-string test for newer XEmacs versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ebuild-mode.el (ebuild-mode-time-string): Test if format-time-string can accept three arguments. Signed-off-by: Ulrich Müller --- ChangeLog | 3 +++ ebuild-mode.el | 8 +++++--- 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 + * 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") -- cgit v1.2.3-65-gdbad