From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jack Henahan Subject: Re: [PATCH] `org-clock--oldest-date` performance Date: Sat, 20 Jan 2018 15:32:36 -0500 Message-ID: References: <87po64ok7n.fsf@nicolasgoaziou.fr> <87y3ksmm0m.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eczoi-0006jy-SP for emacs-orgmode@gnu.org; Sat, 20 Jan 2018 15:32:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eczof-00072a-PS for emacs-orgmode@gnu.org; Sat, 20 Jan 2018 15:32:44 -0500 Received: from ms11p00im-qufv17100101.me.com ([17.58.37.19]:23885) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eczof-00070m-IH for emacs-orgmode@gnu.org; Sat, 20 Jan 2018 15:32:41 -0500 Received: from process-dkim-sign-daemon.ms11p00im-qufv17100101.me.com by ms11p00im-qufv17100101.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P2V00E00DCFI500@ms11p00im-qufv17100101.me.com> for emacs-orgmode@gnu.org; Sat, 20 Jan 2018 20:32:40 +0000 (GMT) Received: from icloud.com ([127.0.0.1]) by ms11p00im-qufv17100101.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P2V00GFEFQCDI10@ms11p00im-qufv17100101.me.com> for emacs-orgmode@gnu.org; Sat, 20 Jan 2018 20:32:40 +0000 (GMT) In-reply-to: <87y3ksmm0m.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Nicolas Goaziou writes: I tested that `org-clock-display` and the clocktable work as expected when `org-clock-display-default-range` is set to `untilnow`. `org-clock-sum-custom` also appears to function as intended. If I'm reading things correctly, the `untilnow` case is the only one that ought to be affected, since it's the only one that used `org-clock--oldest-date`. The behavior of `org-clock-special-range` ought to be unchanged in all cases except where this symbol is explicitly used, or the start time is nil for some other reason. Functionally, this means that today `org-clock-special-range` produces a range from the current time until the current time if `start` ends up nil for whatever reason, but with this patch it will instead produce a range from the year -50000 until now. The -50000 hack is entirely for the benefit of `format-time-string`, since otherwise it just gives the current time if its second argument is nil. > Jack Henahan writes: > >> Apologies again, didn't update the commit hash properly. I swear this is >> the last one. :| > > Thank you. However, I'm surprised that `org-clock-special-range' callers > handle a nil start date. Have you tested it? > > If that's true, we don't need the -50000 hack at all. Returning an empty > string might be enough.