From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org-clock-resolving-clocks & idle Date: Wed, 27 Feb 2019 12:30:44 +0100 Message-ID: <87fts9cvtn.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:39737) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyxQd-0002Ul-RR for emacs-orgmode@gnu.org; Wed, 27 Feb 2019 06:31:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyxQc-0003Dx-Kc for emacs-orgmode@gnu.org; Wed, 27 Feb 2019 06:31:11 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:38237) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyxQc-0002qH-CT for emacs-orgmode@gnu.org; Wed, 27 Feb 2019 06:31:10 -0500 In-Reply-To: (=?utf-8?Q?=22Micha=C3=ABl?= Cadilhac"'s message of "Mon, 25 Feb 2019 17:01:15 +0000") 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: =?utf-8?Q?Micha=C3=ABl?= Cadilhac Cc: emacs-orgmode@gnu.org Hello, Micha=C3=ABl Cadilhac writes: > CONTEXT: When I'm idling with the clock running, Org asks if I want > to resolve the clock when I come back (this is by setting > org-clock-idle-time). > > PROBLEM: I'm not sure how recent the change was, but Org started > asking me _multiple times_ what I want to do when back. Could you provide an ECM? > CAUSE: It seems that the mechanism that prevents multiple such > questions is broken. It boils down to checking whether > org-clock-resolving-clocks is non-nil in org-resolve-clocks-if-idle. > The problem is that org-resolve-clocks-if-idle then calls > org-clock-resolve, which does *not* change org-clock-resolving-clocks > (that's the job of org-resolve-clocks, it seems). > > POSSIBLE SOLUTION: (if we agree there is a problem) Check for > org-clock-resolving-clocks-due-to-idleness rather than > org-clock-resolving-clocks in org-resolve-clocks-if-idle. How does > that sound? I don't know well this part of the code base. A cursory look at commit abfc6babcaf6e20a4c12e5c4754ce107ddc0dc7b didn't help much.=20 Maybe `org-resolve-clocks-if-idle' could check for `org-clock-resolving-clocks-due-to-idleness' /in addition/ to `org-clock-resolving-clocks'. > Maybe org-clock-resolve should also set > org-clock-resolving-clocks; is there a use case where > org-clock-resolve may be called multiple times (with timers probably) > with different clocks, and we'd want all of them to prompt the user? I don't understand. `org-clock-resolving-clocks' is meant to prevent calling low-level function `org-clock-resolve' unnecessarily. I don't see a need for setting it also in `org-clock-resolve'. Regards, --=20 Nicolas Goaziou