From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] `org-clock--oldest-date` performance Date: Sun, 21 Jan 2018 10:42:00 +0100 Message-ID: <87lggrmtuf.fsf@nicolasgoaziou.fr> 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]:39043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edC8d-0002QD-7o for emacs-orgmode@gnu.org; Sun, 21 Jan 2018 04:42:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edC8Y-0000CM-Nh for emacs-orgmode@gnu.org; Sun, 21 Jan 2018 04:42:07 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:57847) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edC8Y-00009n-Gh for emacs-orgmode@gnu.org; Sun, 21 Jan 2018 04:42:02 -0500 In-Reply-To: (Jack Henahan's message of "Sat, 20 Jan 2018 15:32:36 -0500") 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: Jack Henahan Cc: emacs-orgmode@gnu.org Hello, Jack Henahan writes: > 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 That's not true. Currently, `org-clock-special-range' never returns a nil start time. This is where I don't understand your patch: > - (`untilnow org-clock--oldest-date) > + (`untilnow nil) > (_ (encode-time 0 m h d month y)))) > (end (pcase key > (`interactive (org-read-date nil t nil "Range end? ")) > @@ -2283,8 +2251,12 @@ have priority." > (`interactive "(Range interactively set)") > (`untilnow "now")))) > (if (not as-strings) (list start end text) ^^^^^ this can now be nil > - (let ((f (cdr org-time-stamp-formats))) > - (list (format-time-string f start) > + (let ((f (cdr org-time-stamp-formats)) > + (safe-start > + (if (not start) > + (encode-time 0 0 0 0 0 -50000) > + start))) > + (list (format-time-string f safe-start) > (format-time-string f end) > text)))))) Why not replacing `org-clock--oldest-date' with (encode-time 0 0 0 0 0 -50000) in the let binding above? Regards, -- Nicolas Goaziou