From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#59506: 29.0.50; (time-since nil) return format change Date: Wed, 23 Nov 2022 15:09:30 +0200 Message-ID: <83fse9zuk5.fsf@gnu.org> References: <875yf6w013.fsf@luois.me> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26411"; mail-complaints-to="usenet@ciao.gmane.io" Cc: merrick@luois.me, 59506@debbugs.gnu.org To: Juanma Barranquero , Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 23 14:10:27 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxpWE-0006a9-CE for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Nov 2022 14:10:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxpVx-0006xQ-0O; Wed, 23 Nov 2022 08:10:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxpVr-0006vt-4G for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 08:10:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oxpVq-00014G-8K for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 08:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oxpVq-0004w2-1f for bug-gnu-emacs@gnu.org; Wed, 23 Nov 2022 08:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Nov 2022 13:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59506 X-GNU-PR-Package: emacs Original-Received: via spool by 59506-submit@debbugs.gnu.org id=B59506.166920896318913 (code B ref 59506); Wed, 23 Nov 2022 13:10:01 +0000 Original-Received: (at 59506) by debbugs.gnu.org; 23 Nov 2022 13:09:23 +0000 Original-Received: from localhost ([127.0.0.1]:54150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxpVD-0004uy-7h for submit@debbugs.gnu.org; Wed, 23 Nov 2022 08:09:23 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oxpVA-0004uk-QX for 59506@debbugs.gnu.org; Wed, 23 Nov 2022 08:09:21 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxpV4-0000x5-5E; Wed, 23 Nov 2022 08:09:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=R99fVNSN0/eloTQ3jIVwRX7ydI6B/xAxop85OT0SL7g=; b=nXOFZWuIqhoN JJV30L31vcj42KX/GLEWx+v0xplThSb3wtH6uwDgRbwmfPAmA77AKCP3WouRH/3s3LgJ3LLiTLCQr F3+Cwpf8W7Ik6+kbRqkTkiRm3EpLhhavNpegMgvqbvBtOMeYO2KoShSRAaU8hQyFaQBuOzjk8LbpF eeA3NmaLKeyNM9yQpTaYpO7XAx8s9gAdJSUdEHudnXa4YdK5iN0DT7IhVTMy9oIQU2GW0QJB9JWz+ gSxHMKYvfuCzL1LnOQNirNNgdSj5AJ9aae8pL9Tzyj1oSLXf1TRIHu2PHkZDirHcGdijMJvUNvcSN qbeh07zIUIoBeUG4BMnM7A==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxpV3-0000hV-LW; Wed, 23 Nov 2022 08:09:13 -0500 In-Reply-To: (message from Juanma Barranquero on Wed, 23 Nov 2022 10:13:38 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:248739 Archived-At: > Cc: 59506@debbugs.gnu.org > From: Juanma Barranquero > 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)))