From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: BUG: org-capture saves an incorrect clock marker in org-clock-history Date: Thu, 24 Jun 2010 09:37:36 -0400 Message-ID: <87vd98eelb.fsf@gollum.intra.norang.ca> References: <87hbktusex.fsf@gollum.intra.norang.ca> <87bpb1w4id.fsf_-_@gollum.intra.norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=47559 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORmci-0006fv-Ga for emacs-orgmode@gnu.org; Thu, 24 Jun 2010 09:37:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORmcg-0008CG-Ve for emacs-orgmode@gnu.org; Thu, 24 Jun 2010 09:37:44 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:57304) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORmcg-0008CC-SG for emacs-orgmode@gnu.org; Thu, 24 Jun 2010 09:37:42 -0400 In-Reply-To: (Carsten Dominik's message of "Thu\, 24 Jun 2010 07\:39\:28 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: Org Mode Thanks this works now. Regards, Bernt Carsten Dominik writes: > Hi Bernt, > > this one should be fixed now. > > - Carsten > > On Jun 24, 2010, at 4:25 AM, Bernt Hansen wrote: > >> Hi Carsten, >> >> I have the following templates converted from my remember templates. >> I've enabled clock in and clock resume for all templates. >> >> (global-set-key (kbd "C-c c") 'org-capture) >> >> org-capture-templates >> Value: >> (("t" "todo" entry >> (file "~/git/org/refile.org") >> "* TODO %?\n %U\n %a" :clock-in t :clock-resume t) >> ("n" "note" entry >> (file "~/git/org/refile.org") >> "* %? >> :NOTE :\n %U\n %a\n :CLOCK:\n :END:" :clock-in t :clock-resume >> t) >> ("a" "appointment" entry >> (file+headline "~/git/org/todo.org" "Appointments") >> "* %?\n %U" :clock-in t :clock-resume t) >> ("w" "org-protocol" entry >> (file "~/git/org/refile.org") >> "* TODO Review %c\n %U" :immediate-finish t :clock-in t :clock- >> resume t)) >> >> If I try to create a simple capture note with the 't' template like >> this: >> >> C-c c t >> and then file the note with C-c C-c >> >> org-clock-history gets a marker in no buffer added to the list. >> >> org-clock-history is a variable defined in `org-clock.el'. >> Its value is >> (# # #> 59699 in org.org> ... >> ^^^^^^^^^^^^^^^^^^^^^^^ >> >> Clocking in another task cleans up the clock history but this entry is >> wrong. I have a function mapped to F9-SPC that goes to the last >> clocked >> in task by using the marker from org-clock-history directly and when >> it >> hits this marker in no buffer it fails with an error. >> >> (global-set-key (kbd " SPC") 'bh/clock-in-last-task) >> >> (defun bh/clock-in-last-task () >> "Clock in the interrupted task if there is one" >> (interactive) >> (let ((clock-in-to-task (if (org-clock-is-active) >> (setq clock-in-to-task (cadr org-clock-history)) >> (setq clock-in-to-task (car org-clock-history))))) >> (org-with-point-at clock-in-to-task >> (org-clock-in nil)))) >> >> Let me know if you need any additional information. >> >> Regards, >> Bernt > > - Carsten