From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id OVIEKW6NMF//QAAA0tVLHw (envelope-from ) for ; Sun, 09 Aug 2020 23:57:34 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 6mxgJG6NMF/eUwAA1q6Kng (envelope-from ) for ; Sun, 09 Aug 2020 23:57:34 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E72CF9403A0 for ; Sun, 9 Aug 2020 23:57:33 +0000 (UTC) Received: from localhost ([::1]:43610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k4vBz-00054l-86 for larch@yhetil.org; Sun, 09 Aug 2020 19:57:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k4vBd-00054Z-Ig for emacs-orgmode@gnu.org; Sun, 09 Aug 2020 19:57:09 -0400 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]:43092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k4vBc-0003cM-0N for emacs-orgmode@gnu.org; Sun, 09 Aug 2020 19:57:09 -0400 Received: by mail-oi1-x229.google.com with SMTP id l84so7405855oig.10 for ; Sun, 09 Aug 2020 16:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=HjPPXPYaXbKQtWRBuWZPClwCZwnQfsUfG313WFSyNwk=; b=WHvmfMTMH17A9nFV/QcwvZF7B+wk5vnXzBwTHXFyJ8oP5nqhnyn6FpyJyGOTqiVtk/ nog0Z968I2mlNKr/H4jp6IuvCeIfs9kGmMAJEGR4in89/EBXK6LIBxn1jpmERAZSMIX2 yk1uPVQs49nVUi4TOEu9SBCUpA70aM0JGacI1cMc8JBDqjlLscBwcOhBLAk8JbtzCHkr H8ZhwZXWox4riLjs1P4StYy+GUjKoEFwG3td2dk+vD8gEsfDnIaTwWpisBgbtIbYYSM2 RR9LnnvX8I+1ELb+OyAr4yy2kmqLoQIGBgIw45dAfrKzMwhUIT8dCr+V9/EwdDvsGcus J0NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=HjPPXPYaXbKQtWRBuWZPClwCZwnQfsUfG313WFSyNwk=; b=q9Uxya2og9hFrUwklBbV4hpBnkKEk3WaGmiRoXcrnNoXm0fGICtv7ruAq/4DpGwN6w b3ETwa4jLoOe1gD3k9G6XwsnS2icGoSUI9ooBEG69eDeHXMwK+Pf0j0WOpNOPls2fANu QWljiTls0F4JmEt2fysKQx9YFXT4BCyJ8bgW5gvY9oLwvjgTnqkbsjNmzn5E2cMTTbz0 O2LKOEj/UtuPZog1/l4fTp1Rt/Atw/vUiSKFNxmwO+YAi8hQsMRgjq6EGgFVR/99NtGT qKdLja5n95IYBeTL9GG5KPruDs9RHL6TLVa1XSFM6MIpQrimoKq9/L8ehRsJUhu7jJc9 HdAw== X-Gm-Message-State: AOAM532j32tv/vLG3sbyQQmo1850H1C7e1tnU6MbKGIGAZSDcn327Z7n 3wQmeKkkX/xBWUFAkcPz8joZ9WAa X-Google-Smtp-Source: ABdhPJzLnAgK/SamUpiEITxvIjPTbWGzY19SNvJjN4+P5gBS4nHtRUBlXITMGXs6wdZjCdDIPyQIdg== X-Received: by 2002:aca:2818:: with SMTP id 24mr20287157oix.83.1597017425590; Sun, 09 Aug 2020 16:57:05 -0700 (PDT) Received: from ArchLinuvo ([2600:1700:4270:a8e0::614]) by smtp.gmail.com with ESMTPSA id 102sm3125440oth.3.2020.08.09.16.57.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Aug 2020 16:57:04 -0700 (PDT) From: Benson Chu To: emacs-orgmode@gnu.org Subject: [PATCH] Update org-clock-out-time when resolving clocks Date: Sun, 09 Aug 2020 18:54:52 -0500 Message-ID: <87wo275q9f.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::229; envelope-from=bensonchu457@gmail.com; helo=mail-oi1-x229.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=WHvmfMTM; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.21 X-TUID: VlTPCocsfWYd --=-=-= Content-Type: text/plain Hello, I noticed this while using `org-resolve-clocks' when `org-clock-continuously' was set to true. Let's say I clock into "Task 1" at 12:00, and then at 12:30, I start working on "Task 2". Then, at 12:45, I notice that I forgot to clock out of "Task 1". No worries, org-mode has `org-resolve-clocks'! So, I invoke `org-resolve-clocks', keep 30 minutes, and then clock into "Task 2". However, when I clock in, the clock start time is 12:45, violating the promise that `org-clock-continuously' makes. This patch updates the variable `org-clock-out-time' when `org-clock-out' gets passed an `at-time', which fixes the issue I run into. The patch is attached. Is there anything else I need to do? Thanks, Benson --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-clock.el-Update-org-clock-out-time-from-org-reso.patch Content-Description: org-clock-out-time patch >From f78ed7389de153b4270c67df09eedaeb114dc64a Mon Sep 17 00:00:00 2001 From: Benson Chu Date: Sun, 9 Aug 2020 17:57:51 -0500 Subject: [PATCH] org-clock.el: Update org-clock-out-time from org-resolve-clocks * lisp/org-clock.el (org-clock-out): If `at-time' was passed, set org-clock-out-time to that value. Otherwise, set it to now. --- lisp/org-clock.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index b184fc3a3..0dd495493 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1645,7 +1645,7 @@ to, overriding the existing value of `org-clock-out-switch-to-state'." org-clock-out-switch-to-state)) (now (org-current-time org-clock-rounding-minutes)) ts te s h m remove) - (setq org-clock-out-time now) + (setq org-clock-out-time (or at-time now)) (save-excursion ; Do not replace this with `with-current-buffer'. (with-no-warnings (set-buffer (org-clocking-buffer))) (save-restriction -- 2.28.0 --=-=-=--