Gnus development mailing list
 help / color / mirror / Atom feed
From: Simon Josefsson <jas@extundo.com>
Subject: Re: expiry problems?
Date: Sat, 10 Nov 2001 20:04:33 +0100	[thread overview]
Message-ID: <iluu1w2moqm.fsf@dhcp128.extundo.com> (raw)
In-Reply-To: <87vggitswm.fsf@mclinux.com> (Josh Huber's message of "Sat, 10 Nov 2001 12:52:41 -0500")

Josh Huber <huber@alum.wpi.edu> writes:

>> (time-less-p (days-to-time 7)
>>              (time-since (date-to-time "Jan 1 00:00:00 1940")))
>> t
>
> This returns nil for me.  Maybe it's an XEmacs bug?  I see you're
> running emacs21...

Yes.  The patch below fixes it, someone at xemacs-patches please have
a look at it.

XEmacs 21.1, 21.4 (without patch):

(encode-time 0 0 1 1 1 1969 nil nil 3600)
(65054 52352)

Emacs 20.7, 21.1 (and XEmacs 21.4 with patch):

(encode-time 0 0 1 1 1 1969 nil nil 3600)
(-482 52352)

2001-11-10  Simon Josefsson  <jas@extundo.com>

	* editfns.c (make_time): New function, from Emacs.
	(Fencode_time): Use it, instead of `wasteful_word_to_lisp'.

--- editfns.c.~1.27.2.2.~	Wed Nov  7 20:43:02 2001
+++ editfns.c	Sat Nov 10 19:57:27 2001
@@ -1176,6 +1176,14 @@
 
 static void set_time_zone_rule (char *tzstring);
 
+Lisp_Object
+make_time (time)
+     time_t time;
+{
+  return Fcons (make_int (time >> 16),
+		Fcons (make_int (time & 0177777), Qnil));
+}
+
 DEFUN ("encode-time", Fencode_time, 6, MANY, 0, /*
   Convert SECOND, MINUTE, HOUR, DAY, MONTH, YEAR and ZONE to internal time.
 This is the reverse operation of `decode-time', which see.
@@ -1249,7 +1257,7 @@
   if (the_time == (time_t) -1)
     error ("Specified time is not representable");
 
-  return wasteful_word_to_lisp (the_time);
+  return make_time (the_time);
 }
 
 DEFUN ("current-time-string", Fcurrent_time_string, 0, 1, 0, /*




  reply	other threads:[~2001-11-10 19:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-09 14:32 Josh Huber
2001-11-09 15:53 ` Harry Putnam
2001-11-09 16:56 ` Matt Armstrong
2001-11-09 18:09   ` Josh Huber
2001-11-09 19:17     ` Matt Armstrong
2001-11-09 23:00       ` Josh Huber
2001-11-10 11:11         ` Simon Josefsson
2001-11-10 17:52           ` Josh Huber
2001-11-10 19:04             ` Simon Josefsson [this message]
2001-11-21  6:32               ` Stephen J. Turnbull

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=iluu1w2moqm.fsf@dhcp128.extundo.com \
    --to=jas@extundo.com \
    /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).