From: Benson Chu <bensonchu457@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Update org-clock-out-time when resolving clocks
Date: Sun, 09 Aug 2020 18:54:52 -0500 [thread overview]
Message-ID: <87wo275q9f.fsf@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 717 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-clock-out-time patch --]
[-- Type: text/x-patch, Size: 1030 bytes --]
From f78ed7389de153b4270c67df09eedaeb114dc64a Mon Sep 17 00:00:00 2001
From: Benson Chu <bensonchu457@gmail.com>
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
next reply other threads:[~2020-08-09 23:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-09 23:54 Benson Chu [this message]
2020-08-17 4:13 ` [PATCH] Update org-clock-out-time when resolving clocks Kyle Meyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wo275q9f.fsf@gmail.com \
--to=bensonchu457@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).