emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: emacs-orgmode@gnu.org
Cc: Bernt Hansen <bernt@norang.ca>
Subject: [PATCH] Fix clocking on capture completion
Date: Sat, 24 Jul 2010 10:20:17 -0400	[thread overview]
Message-ID: <1279981217-14625-1-git-send-email-bernt@norang.ca> (raw)
In-Reply-To: <AANLkTimAMavZAViDyfJ446ez9qVu5MAc1M65A1rBgG22@mail.gmail.com>

* lisp/org-capture.el (org-capture-finalize): Fix clock in of interrupted
task during capture finalize

Calling org-capture-get inside the org-with-point-at macro does not
work when the current clocking task and the capture target buffer are
the same.  In this case the captured task would continue clocking
instead of switching back to the previously clocking task.
---
I think this patch fixes the issue but it should receive more testing.
Please report back if this works or not.

-Bernt


 lisp/org-capture.el |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index cf09dce..2efed78 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -467,8 +467,9 @@ bypassed."
 	       (markerp (org-capture-get :interrupted-clock 'local))
 	       (buffer-live-p (marker-buffer
 			       (org-capture-get :interrupted-clock 'local))))
-      (org-with-point-at (org-capture-get :interrupted-clock 'local)
-	(org-clock-in))
+      (let ((clock-in-task (org-capture-get :interrupted-clock 'local)))
+	(org-with-point-at clock-in-task
+	  (org-clock-in)))
       (message "Interrupted clock has been resumed")))
 
   (let ((beg (point-min))
-- 
1.7.2

  parent reply	other threads:[~2010-07-24 14:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-23 12:59 Issue with correctly resuming interrupted timer Benjamin Beckwith
2010-07-24  5:59 ` Bernt Hansen
2010-07-24 14:20 ` Bernt Hansen [this message]
2010-07-24 18:41   ` [PATCH] Fix clocking on capture completion Viktor Rosenfeld
2010-07-24 18:45     ` Bernt Hansen
2010-07-24 22:09       ` Viktor Rosenfeld

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=1279981217-14625-1-git-send-email-bernt@norang.ca \
    --to=bernt@norang.ca \
    --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).