emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master bfee9fa 2/6: Remove the gnus-float-time alias


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master bfee9fa 2/6: Remove the gnus-float-time alias
Date: Sat, 13 Feb 2016 06:43:30 +0000

branch: master
commit bfee9fab2f51a94db68247c6ee6eedebb7669209
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Remove the gnus-float-time alias
    
    * lisp/gnus/gnus-util.el (gnus-completion-styles): Remove
    compat code.
    (gnus-float-time): Remove.
---
 lisp/gnus/ecomplete.el   |    6 +-----
 lisp/gnus/gnus-delay.el  |    8 ++++----
 lisp/gnus/gnus-sum.el    |    6 +++---
 lisp/gnus/gnus-util.el   |   18 ++++--------------
 lisp/gnus/mail-source.el |    4 +---
 lisp/gnus/nnimap.el      |    2 +-
 lisp/gnus/nnspool.el     |    2 +-
 7 files changed, 15 insertions(+), 31 deletions(-)

diff --git a/lisp/gnus/ecomplete.el b/lisp/gnus/ecomplete.el
index 76beb40..cb50cce 100644
--- a/lisp/gnus/ecomplete.el
+++ b/lisp/gnus/ecomplete.el
@@ -55,11 +55,7 @@
 
 (defun ecomplete-add-item (type key text)
   (let ((elems (assq type ecomplete-database))
-       (now (string-to-number
-             (format "%.0f" (if (featurep 'emacs)
-                                (float-time)
-                              (require 'gnus-util)
-                              (gnus-float-time)))))
+       (now (string-to-number (format "%.0f" (float-time))))
        entry)
     (unless elems
       (push (setq elems (list type)) ecomplete-database))
diff --git a/lisp/gnus/gnus-delay.el b/lisp/gnus/gnus-delay.el
index 93069e5..2f387fc 100644
--- a/lisp/gnus/gnus-delay.el
+++ b/lisp/gnus/gnus-delay.el
@@ -103,10 +103,10 @@ DELAY is a string, giving the length of the time.  
Possible values are:
           (aset deadline 1 minute)
           (aset deadline 2 hour)
           ;; Convert to seconds.
-          (setq deadline (gnus-float-time (apply 'encode-time
-                                                 (append deadline nil))))
+          (setq deadline (float-time (apply 'encode-time
+                                            (append deadline nil))))
           ;; If this time has passed already, add a day.
-          (when (< deadline (gnus-float-time))
+          (when (< deadline (float-time))
             (setq deadline (+ 86400 deadline))) ; 86400 secs/day
           ;; Convert seconds to date header.
           (setq deadline (message-make-date
@@ -129,7 +129,7 @@ DELAY is a string, giving the length of the time.  Possible 
values are:
                 (t
                  (setq delay (* num 60))))
           (setq deadline (message-make-date
-                          (seconds-to-time (+ (gnus-float-time) delay)))))
+                          (seconds-to-time (+ (float-time) delay)))))
          (t (error "Malformed delay `%s'" delay)))
     (message-add-header (format "%s: %s" gnus-delay-header deadline)))
   (set-buffer-modified-p t)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 89a5ca2..5fb566e 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -3848,8 +3848,8 @@ respectively."
 Returns \"  ?  \" if there's bad input or if another error occurs.
 Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"."
   (condition-case ()
-      (let* ((messy-date (gnus-float-time (gnus-date-get-time messy-date)))
-            (now (gnus-float-time))
+      (let* ((messy-date (float-time (gnus-date-get-time messy-date)))
+            (now (float-time))
             ;;If we don't find something suitable we'll use this one
             (my-format "%b %d '%y"))
        (let* ((difference (- now messy-date))
@@ -5061,7 +5061,7 @@ Unscored articles will be counted as having a score of 
zero."
 (defun gnus-thread-latest-date (thread)
   "Return the highest article date in THREAD."
   (apply 'max
-        (mapcar (lambda (header) (gnus-float-time
+        (mapcar (lambda (header) (float-time
                                   (gnus-date-get-time
                                    (mail-header-date header))))
                 (message-flatten-list thread))))
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 6ca0de3..23a1676 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -52,13 +52,10 @@
                 gnus-iswitchb-completing-read)))
 
 (defcustom gnus-completion-styles
-  (if (and (boundp 'completion-styles-alist)
-           (boundp 'completion-styles))
-      (append (when (and (assq 'substring completion-styles-alist)
-                         (not (memq 'substring completion-styles)))
-                (list 'substring))
-              completion-styles)
-    nil)
+  (append (when (and (assq 'substring completion-styles-alist)
+                    (not (memq 'substring completion-styles)))
+           (list 'substring))
+         completion-styles)
   "Value of `completion-styles' to use when completing."
   :version "24.1"
   :group 'gnus-meta
@@ -291,13 +288,6 @@ Symbols are also allowed; their print names are used 
instead."
        (and (= (car fdate) (car date))
             (> (nth 1 fdate) (nth 1 date))))))
 
-;; Every version of Emacs Gnus supports has built-in float-time.
-;; The featurep test silences an irritating compiler warning.
-(defalias 'gnus-float-time
-  (if (or (featurep 'emacs)
-         (fboundp 'float-time))
-      'float-time 'time-to-seconds))
-
 ;;; Keymap macros.
 
 (defmacro gnus-local-set-keys (&rest plist)
diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el
index 2388a1a..21398d1 100644
--- a/lisp/gnus/mail-source.el
+++ b/lisp/gnus/mail-source.el
@@ -629,8 +629,6 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff 
bfile)
        0)
     (funcall callback mail-source-crash-box info)))
 
-(autoload 'gnus-float-time "gnus-util")
-
 (defvar mail-source-incoming-last-checked-time nil)
 
 (defun mail-source-delete-crash-box ()
@@ -651,7 +649,7 @@ Deleting old (> %s day(s)) incoming mail file `%s'." diff 
bfile)
          ;; Don't check for old incoming files more than once per day to
          ;; save a lot of file accesses.
          (when (or (null mail-source-incoming-last-checked-time)
-                   (> (gnus-float-time
+                   (> (float-time
                        (time-since mail-source-incoming-last-checked-time))
                       (* 24 60 60)))
            (setq mail-source-incoming-last-checked-time (current-time))
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index c6f54da..eefe1a1 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -365,7 +365,7 @@ textual parts.")
        (with-current-buffer buffer
          (when (and nnimap-object
                     (nnimap-last-command-time nnimap-object)
-                    (> (gnus-float-time
+                    (> (float-time
                         (time-subtract
                          now
                          (nnimap-last-command-time nnimap-object)))
diff --git a/lisp/gnus/nnspool.el b/lisp/gnus/nnspool.el
index 07624f2..9db68b1 100644
--- a/lisp/gnus/nnspool.el
+++ b/lisp/gnus/nnspool.el
@@ -306,7 +306,7 @@ there.")
                          "\\([^ ]+\\) +\\([0-9]+\\)[0-9][0-9][0-9] "))
                    (zerop (forward-line -1))))
        ;; We require nnheader which requires gnus-util.
-       (let ((seconds (gnus-float-time (date-to-time date)))
+       (let ((seconds (float-time (date-to-time date)))
              groups)
          ;; Go through lines and add the latest groups to a list.
          (while (and (looking-at "\\([^ ]+\\) +[0-9]+ ")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]