unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Juanma Barranquero <lekktu@gmail.com>, Paul Eggert <eggert@cs.ucla.edu>
Cc: merrick@luois.me, 59506@debbugs.gnu.org
Subject: bug#59506: 29.0.50; (time-since nil) return format change
Date: Wed, 23 Nov 2022 15:09:30 +0200	[thread overview]
Message-ID: <83fse9zuk5.fsf@gnu.org> (raw)
In-Reply-To: <CAAeL0SR+szARFJFknmu0DS9YytpaazDYUZ+8H79GWzB+C2JHOQ@mail.gmail.com> (message from Juanma Barranquero on Wed, 23 Nov 2022 10:13:38 +0100)

> Cc: 59506@debbugs.gnu.org
> From: Juanma Barranquero <lekktu@gmail.com>
> Date: Wed, 23 Nov 2022 10:13:38 +0100
> 
> In most cases, nil is assumed to be the current time. `time-subtract' is doing that here.

Adding Paul.  Paul, any comments?

> It could be "fixed" so
> 
> diff --git i/lisp/calendar/time-date.el w/lisp/calendar/time-date.el
> index bbdcaa4db4..27ce10d7d6 100644
> --- i/lisp/calendar/time-date.el
> +++ w/lisp/calendar/time-date.el
> @@ -200,5 +200,5 @@ time-since
>      ;; Convert date strings to internal time.
>      (setq time (date-to-time time)))
> -  (time-subtract nil time))
> +  (time-subtract nil (or time (current-time))))
>  
>  ;;;###autoload
> 
> but that would make the result inconsistent:
> 
> ELISP> (time-since nil)
> (0 0 0 0)
> 
> ELISP> (time-since nil)
> (0 0 1 0)
> 
> I'm not sure that's better. And you can always do 
> 
> (time-since (or time (current-time)))





  reply	other threads:[~2022-11-23 13:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23  8:24 bug#59506: 29.0.50; (time-since nil) return format change Merrick Luo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-23  9:13 ` Juanma Barranquero
2022-11-23 13:09   ` Eli Zaretskii [this message]
2022-11-24 21:03     ` Paul Eggert
2022-11-25  6:50       ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83fse9zuk5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=59506@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=lekktu@gmail.com \
    --cc=merrick@luois.me \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).