Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: Glenn Morris <rgm@gnu.org>
Cc: ding@gnus.org, emacs-devel@gnu.org
Subject: Gnus and No Gnus
Date: Mon, 07 Sep 2009 21:07:57 +0900	[thread overview]
Message-ID: <b4mvdjvez4y.fsf@jpl.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 791 bytes --]

Hi,

Today I tried synch'ing the Gnus trunk with the Emacs trunk and
found a problem concerning `float-time'.

In time-date.el, `define-obsolete-function-alias' is not available
in Emacs 21 that Gnus still supports.  It causes an error when
loading gnus-load.el.

In ecomplete.el, gnus-util.el and time-date.el, (featurep 'xemacs)
is used for checking if `float-time' is available like this:

  (if (featurep 'xemacs)
      (time-to-seconds time)
    (float-time time))

However, XEmacs may implement `float-time' in the future.

Therefore I made changes in those files as attached below.  WDYT?
The whole patch that synch the Gnus trunk with the Emacs trunk is:

ftp://ftp.jpl.org/pub/tmp/Gnus-Emacs-20090907.diff.gz
of http://www.jpl.org/ftp/pub/tmp/Gnus-Emacs-20090907.diff.gz

Regards,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 4003 bytes --]

*** lisp/calendar/time-date.el~	2009-09-02 21:50:25 +0000
--- lisp/calendar/time-date.el	2009-09-07 11:55:15 +0000
***************
*** 114,130 ****
  ;; 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 (featurep 'xemacs)
! ;;;###autoload     (autoload 'time-to-seconds "time-date")
! ;;;###autoload   (define-obsolete-function-alias 'time-to-seconds 'float-time "21.1"))
! 
! (if (featurep 'xemacs)
!     (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)
--- 114,132 ----
  ;; 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 (fboundp '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"))
! 
! (unless (fboundp '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)
***************
*** 251,259 ****
  (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."
!   (/ (if (featurep 'xemacs)
!          (time-to-seconds time)
!        (float-time time)) (* 60 60 24)))
  
  ;;;###autoload
  (defun safe-date-to-time (date)
--- 253,262 ----
  (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."
!   (/ (if (fboundp 'float-time)
! 	 (float-time time)
!        (time-to-seconds time))
!      (* 60 60 24)))
  
  ;;;###autoload
  (defun safe-date-to-time (date)
*** lisp/gnus/ecomplete.el~	2009-09-02 21:50:26 +0000
--- lisp/gnus/ecomplete.el	2009-09-07 11:55:15 +0000
***************
*** 56,64 ****
  (defun ecomplete-add-item (type key text)
    (let ((elems (assq type ecomplete-database))
  	(now (string-to-number
! 	      (format "%.0f" (if (featurep 'xemacs)
! 				 (time-to-seconds (current-time))
! 			       (float-time)))))
  	entry)
      (unless elems
        (push (setq elems (list type)) ecomplete-database))
--- 56,64 ----
  (defun ecomplete-add-item (type key text)
    (let ((elems (assq type ecomplete-database))
  	(now (string-to-number
! 	      (format "%.0f" (if (fboundp 'float-time)
! 				 (float-time)
! 			       (time-to-seconds (current-time))))))
  	entry)
      (unless elems
        (push (setq elems (list type)) ecomplete-database))
*** lisp/gnus/gnus-util.el~	2009-09-02 21:50:26 +0000
--- lisp/gnus/gnus-util.el	2009-09-07 11:55:15 +0000
***************
*** 285,296 ****
  	(and (= (car fdate) (car date))
  	     (> (nth 1 fdate) (nth 1 date))))))
  
! (defun gnus-float-time (&optional time)
!   "Convert time value TIME to a floating point number.
  TIME defaults to the current time."
!   (if (featurep 'xemacs)
!       (time-to-seconds (or time (current-time)))
!     (float-time time)))
  
  ;;; Keymap macros.
  
--- 285,296 ----
  	(and (= (car fdate) (car date))
  	     (> (nth 1 fdate) (nth 1 date))))))
  
! (if (fboundp '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."
!     (time-to-seconds (or time (current-time)))))
  
  ;;; Keymap macros.
  

             reply	other threads:[~2009-09-07 12:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-07 12:07 Katsumi Yamaoka [this message]
2009-09-07 21:31 ` Glenn Morris
     [not found] ` <bnocpmzbka.fsf@fencepost.gnu.org>
2009-09-08  2:15   ` Stephen J. Turnbull
2009-09-08  4:46     ` Teemu Likonen
2009-09-15  8:10       ` Steinar Bang
2009-09-08  7:11     ` Glenn Morris
2009-09-15  8:13       ` Steinar Bang
2009-09-15 13:10         ` Ted Zlatanov
2009-09-08  5:15   ` Katsumi Yamaoka
2009-09-08  7:19     ` Glenn Morris
2009-09-08 11:13       ` Katsumi Yamaoka
2009-09-08 16:49         ` Glenn Morris
2009-09-08 19:08           ` Stephen J. Turnbull
2009-09-09  9:31           ` Katsumi Yamaoka
2009-09-15  8:14     ` Steinar Bang
2009-09-15 17:15     ` Reiner Steib

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4mvdjvez4y.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=rgm@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).