From: Juanma Barranquero <lekktu@gmail.com>
To: Merrick Luo <merrick@luois.me>
Cc: 59506@debbugs.gnu.org
Subject: bug#59506: 29.0.50; (time-since nil) return format change
Date: Wed, 23 Nov 2022 10:13:38 +0100 [thread overview]
Message-ID: <CAAeL0SR+szARFJFknmu0DS9YytpaazDYUZ+8H79GWzB+C2JHOQ@mail.gmail.com> (raw)
In-Reply-To: <875yf6w013.fsf@luois.me>
[-- Attachment #1: Type: text/plain, Size: 703 bytes --]
In most cases, nil is assumed to be the current time. `time-subtract' is
doing that here.
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)))
[-- Attachment #2: Type: text/html, Size: 1060 bytes --]
next prev parent reply other threads:[~2022-11-23 9:13 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 [this message]
2022-11-23 13:09 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAAeL0SR+szARFJFknmu0DS9YytpaazDYUZ+8H79GWzB+C2JHOQ@mail.gmail.com \
--to=lekktu@gmail.com \
--cc=59506@debbugs.gnu.org \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.