From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: BUG: org-capture saves an incorrect clock marker in org-clock-history Date: Thu, 24 Jun 2010 07:39:28 +0200 Message-ID: References: <87hbktusex.fsf@gollum.intra.norang.ca> <87bpb1w4id.fsf_-_@gollum.intra.norang.ca> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=60936 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORf9y-0005H0-L0 for emacs-orgmode@gnu.org; Thu, 24 Jun 2010 01:39:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORf9x-0008Qx-3w for emacs-orgmode@gnu.org; Thu, 24 Jun 2010 01:39:34 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:59257) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORf9w-0008Qp-SM for emacs-orgmode@gnu.org; Thu, 24 Jun 2010 01:39:33 -0400 Received: by wyb39 with SMTP id 39so310348wyb.0 for ; Wed, 23 Jun 2010 22:39:32 -0700 (PDT) In-Reply-To: <87bpb1w4id.fsf_-_@gollum.intra.norang.ca> 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: Bernt Hansen Cc: Org Mode 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