Merge changes made in Emacs trunk.
authorGlenn Morris <rgm@gnu.org>
Wed, 10 Nov 2010 06:24:42 +0000 (06:24 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 10 Nov 2010 06:24:42 +0000 (06:24 +0000)
smime.el (from): Remove unused declaration.
gnus-util.el (with-no-warnings): Remove compat stub, now unused.
gnus-util.el (gnus-float-time): On Emacs, always an alias.
ecomplete.el (with-no-warnings): Remove compat stub, now unused.
ecomplete.el (ecomplete-add-item): Use float-time on Emacs, else gnus-float-time.
time-date.el (time-to-seconds): Always an alias on Emacs, never a real function.
time-date.el (with-no-warnings): Remove compat stub, now unused.
time-date.el (time-less-p): Doc fix.
time-date.el (time-to-number-of-days): Simplify.

lisp/ChangeLog
lisp/ecomplete.el
lisp/gnus-util.el
lisp/smime.el
lisp/time-date.el

index 7b8ad2b..09596cc 100644 (file)
@@ -5,6 +5,24 @@
        * gnus-art.el (article-treat-non-ascii): Use put-char-table instead of
        set-char-table-range for XEmacs.
 
+2010-11-10  Glenn Morris  <rgm@gnu.org>
+
+       * time-date.el (time-to-seconds): Always an alias on Emacs,
+       never a real function.
+       (with-no-warnings): Remove compat stub, now unused.
+       (time-less-p): Doc fix.
+       (time-to-number-of-days): Simplify.
+
+       * smime.el (from): Remove unused declaration.
+
+       * gnus-util.el (with-no-warnings): Remove compat stub, now unused.
+       (gnus-float-time): On Emacs, always an alias.
+
+       * ecomplete.el (with-no-warnings): Remove compat stub, now unused.
+       (ecomplete-add-item): Use float-time on Emacs, else gnus-float-time.
+
+2010-11-10  Katsumi Yamaoka  <yamaoka@jpl.org>
+
        * dgnushack.el: Don't use ignore-errors in the top level form since it
        is unavailable in XEmacs even if cl is loaded.
 
index 33d2ddd..1f70567 100644 (file)
@@ -1,6 +1,7 @@
 ;;; ecomplete.el --- electric completion of addresses and the like
 
-;; Copyright (C) 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+;; Copyright (C) 2006, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: mail
 (eval-when-compile
   (require 'cl))
 
-(eval-when-compile
-  (unless (fboundp 'with-no-warnings)
-    (defmacro with-no-warnings (&rest body)
-      `(progn ,@body))))
-
 (defgroup ecomplete nil
   "Electric completion of email addresses and the like."
   :group 'mail)
 (defun ecomplete-add-item (type key text)
   (let ((elems (assq type ecomplete-database))
        (now (string-to-number
-             (format "%.0f" (if (and (fboundp 'float-time)
-                                     (subrp (symbol-function 'float-time)))
+             (format "%.0f" (if (featurep 'emacs)
                                 (float-time)
-                              (with-no-warnings
-                                (time-to-seconds (current-time)))))))
+                              (require 'gnus-util)
+                              (gnus-float-time)))))
        entry)
     (unless elems
       (push (setq elems (list type)) ecomplete-database))
index e9e8969..cacca01 100644 (file)
 (eval-when-compile
   (require 'cl))
 
-(eval-when-compile
-  (unless (fboundp 'with-no-warnings)
-    (defmacro with-no-warnings (&rest body)
-      `(progn ,@body))))
-
 (defcustom gnus-completing-read-function 'gnus-emacs-completing-read
   "Function use to do completing read."
   :version "24.1"
@@ -320,13 +315,14 @@ Symbols are also allowed; their print names are used instead."
             (> (nth 1 fdate) (nth 1 date))))))
 
 (eval-and-compile
-  (if (and (fboundp 'float-time)
-          (subrp (symbol-function 'float-time)))
+  (if (or (featurep 'emacs)
+         (and (fboundp 'float-time)
+              (subrp (symbol-function 'float-time))))
       (defalias 'gnus-float-time 'float-time)
     (defun gnus-float-time (&optional time)
       "Convert time value TIME to a floating point number.
 TIME defaults to the current time."
-      (with-no-warnings (time-to-seconds (or time (current-time)))))))
+      (time-to-seconds (or time (current-time))))))
 
 ;;; Keymap macros.
 
index acb50f1..18b5dbd 100644 (file)
@@ -426,8 +426,6 @@ Any details (stdout and stderr) are left in the buffer specified by
     (insert-buffer-substring smime-details-buffer)
     nil))
 
-(defvar from)
-
 (defun smime-decrypt-region (b e keyfile)
   "Decrypt S/MIME message in region between B and E with key in KEYFILE.
 On success, replaces region with decrypted data and return non-nil.
index 52727d7..1bd04d7 100644 (file)
@@ -112,27 +112,24 @@ If DATE lacks timezone information, GMT is assumed."
 ;; 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 (and (fboundp 'float-time)
-;;;###autoload         (subrp (symbol-function 'float-time)))
+;;;###autoload(if (or (featurep 'emacs)
+;;;###autoload        (and (fboundp 'float-time)
+;;;###autoload             (subrp (symbol-function 'float-time))))
 ;;;###autoload    (progn
 ;;;###autoload      (defalias 'time-to-seconds 'float-time)
 ;;;###autoload      (make-obsolete 'time-to-seconds 'float-time "21.1"))
 ;;;###autoload  (autoload 'time-to-seconds "time-date"))
 
-(eval-and-compile
-  (unless (and (fboundp 'float-time)
-              (subrp (symbol-function 'float-time)))
-    (defun time-to-seconds (time)
-      "Convert time value TIME to a floating point number."
-      (with-decoded-time-value ((high low micro time))
-       (+ (* 1.0 high 65536)
-          low
-          (/ micro 1000000.0))))))
-
 (eval-when-compile
-  (unless (fboundp 'with-no-warnings)
-    (defmacro with-no-warnings (&rest body)
-      `(progn ,@body))))
+  (or (featurep 'emacs)
+      (and (fboundp 'float-time)
+           (subrp (symbol-function 'float-time)))
+      (defun time-to-seconds (time)
+        "Convert time value TIME to a floating point number."
+        (with-decoded-time-value ((high low micro time))
+          (+ (* 1.0 high 65536)
+             low
+             (/ micro 1000000.0))))))
 
 ;;;###autoload
 (defun seconds-to-time (seconds)
@@ -143,7 +140,7 @@ If DATE lacks timezone information, GMT is assumed."
 
 ;;;###autoload
 (defun time-less-p (t1 t2)
-  "Say whether time value T1 is less than time value T2."
+  "Return non-nil if time value T1 is earlier than time value T2."
   (with-decoded-time-value ((high1 low1 micro1 t1)
                            (high2 low2 micro2 t2))
     (or (< high1 high2)
@@ -250,23 +247,21 @@ The Gregorian date Sunday, December 31, 1bce is imaginary."
         (month (nth 4 tim))
         (day (nth 3 tim))
         (year (nth 5 tim)))
-    (+ (time-to-day-in-year time)      ;       Days this year
+    (+ (time-to-day-in-year time)      ;       Days this year
        (* 365 (1- year))               ;       + Days in prior years
        (/ (1- year) 4)                 ;       + Julian leap years
        (- (/ (1- year) 100))           ;       - century years
        (/ (1- year) 400))))            ;       + Gregorian leap years
 
-(eval-and-compile
-  (if (and (fboundp 'float-time)
-          (subrp (symbol-function 'float-time)))
-      (defun time-to-number-of-days (time)
-       "Return the number of days represented by TIME.
-The number of days will be returned as a floating point number."
-       (/ (float-time time) (* 60 60 24)))
-    (defun time-to-number-of-days (time)
-      "Return the number of days represented by TIME.
-The number of days will be returned as a floating point number."
-      (/ (with-no-warnings (time-to-seconds time)) (* 60 60 24)))))
+(defun time-to-number-of-days (time)
+  "Return the number of days represented by TIME.
+Returns a floating point number."
+  (/ (funcall (eval-when-compile
+                (if (or (featurep 'emacs)
+                        (and (fboundp 'float-time)
+                             (subrp (symbol-function 'float-time))))
+                    'float-time
+                  'time-to-seconds)) time) (* 60 60 24)))
 
 ;;;###autoload
 (defun safe-date-to-time (date)