Gnus -- Minor tweak define #'time-to-seconds
authorSteve Youngs <steve@sxemacs.org>
Tue, 14 Apr 2020 06:46:03 +0000 (16:46 +1000)
committerSteve Youngs <steve@sxemacs.org>
Tue, 14 Apr 2020 06:46:03 +0000 (16:46 +1000)
* xemacs-packages/gnus/lisp/sxepkg.el: Don't need the float-time
alias any longer.
Autoload #'message-goto-body for mm-extern.el.

* xemacs-packages/gnus/lisp/time-date.el (date-to-time): Put the
autoload cookie where it will actually cause the func to be
autoloaded.
(time-to-seconds): Don't try to be clever with when this is
defined, just define it at toplevel.
(float-time): Inline autoload it.

Signed-off-by: Steve Youngs <steve@sxemacs.org>
xemacs-packages/gnus/lisp/sxepkg.el
xemacs-packages/gnus/lisp/time-date.el

index 18dd1ec..4dcc90e 100644 (file)
@@ -40,7 +40,6 @@
       (setq form (cons 'mapcan (cdr last))))))
 
 (defalias 'set-buffer-multibyte #'ignore)
-(defalias 'float-time #'time-to-seconds)
 (defalias 'gnus-float-time #'time-to-seconds)
 (defalias 'process-type #'process-type-data)
 (defalias 'cancel-timer #'delete-itimer)
      shr-content-function shr-inhibit-images)))
 
 (when (equal "lisp/mm-extern.el" current-file)
+  (autoload 'message-goto-body "message" nil t)
   (maybe-bind '(mode)))
 
 (when (equal "lisp/mm-partial.el" current-file)
index da3e2a2..2937fef 100644 (file)
@@ -140,11 +140,12 @@ it is assumed that PICO was omitted and should be treated as zero."
 (autoload 'parse-time-string "parse-time")
 (autoload 'timezone-make-date-arpa-standard "timezone")
 
-;;;###autoload
 ;; `parse-time-string' isn't sufficiently general or robust.  It fails
 ;; to grok some of the formats that timezone does (e.g. dodgy
 ;; post-2000 stuff from some Elms) and either fails or returns bogus
 ;; values.  timezone-make-date-arpa-standard should help.
+
+;;;###autoload
 (defun date-to-time (date)
   "Parse a string DATE that represents a date-time and return a time value.
 If DATE lacks timezone information, GMT is assumed."
@@ -163,27 +164,43 @@ If DATE lacks timezone information, GMT is assumed."
                (apply 'signal err)
              (error "Invalid date: %s" date)))))))))
 
-;; Bit of a mess.  Emacs has float-time since at least 21.1.
-;; This file is synced to Gnus, and XEmacs packages may have been written
-;; using time-to-seconds from the Gnus library.
-;;;###autoload(if (or (featurep 'emacs)
-;;;###autoload        (and (fboundp 'float-time)
-;;;###autoload             (subrp (symbol-function 'float-time))))
-;;;###autoload    (defalias 'time-to-seconds 'float-time)
-;;;###autoload  (autoload 'time-to-seconds "time-date"))
-
-(eval-when-compile
-  (or (featurep 'emacs)
-      (and (fboundp 'float-time)
-           (subrp (symbol-function 'float-time)))
-      (defun time-to-seconds (&optional time)
-        "Convert optional value TIME to a floating point number.
+;;; "Bit of a mess" is kind of an understatement --SY.
+;;; I'm blocking out the "mess" and not jumping through any autoload
+;;; cookie hoops to appease the Emacs Incompatibility Demons.  This is
+;;; not likely to ever be sync'd back to GNU so it doesn't matter. --SY.
+;; ;; Bit of a mess.  Emacs has float-time since at least 21.1.
+;; ;; This file is synced to Gnus, and XEmacs packages may have been written
+;; ;; using time-to-seconds from the Gnus library.
+;; ;;;###autoload(if (or (featurep 'emacs)
+;; ;;;###autoload        (and (fboundp 'float-time)
+;; ;;;###autoload             (subrp (symbol-function 'float-time))))
+;; ;;;###autoload    (defalias 'time-to-seconds 'float-time)
+;; ;;;###autoload  (autoload 'time-to-seconds "time-date"))
+
+;; (eval-when-compile
+;;   (or (featurep 'emacs)
+;;       (and (fboundp 'float-time)
+;;            (subrp (symbol-function 'float-time)))
+;;       (defun time-to-seconds (&optional time)
+;;         "Convert optional value TIME to a floating point number.
+;; TIME defaults to the current time."
+;;         (with-decoded-time-value ((high low micro pico _type
+;;                                (or time (current-time))))
+;;           (+ (* high 65536.0)
+;;              low
+;;          (/ (+ (* micro 1e6) pico) 1e12))))))
+(eval-when-compile (defvar _type))
+;;;###autoload
+(defun time-to-seconds (&optional time)
+  "Convert optional value TIME to a floating point number.
 TIME defaults to the current time."
         (with-decoded-time-value ((high low micro pico _type
                                   (or time (current-time))))
           (+ (* high 65536.0)
              low
-            (/ (+ (* micro 1e6) pico) 1e12))))))
+            (/ (+ (* micro 1e6) pico) 1e12))))
+
+;;;###autoload(defalias 'float-time 'time-to-seconds)
 
 ;;;###autoload
 (defun seconds-to-time (seconds)