From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: BUG: org-capture saves an incorrect clock marker in org-clock-history Date: Wed, 23 Jun 2010 22:25:46 -0400 Message-ID: <87bpb1w4id.fsf_-_@gollum.intra.norang.ca> References: <87hbktusex.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=35678 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORc8a-0007nB-I6 for emacs-orgmode@gnu.org; Wed, 23 Jun 2010 22:25:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORc8V-0003dA-P0 for emacs-orgmode@gnu.org; Wed, 23 Jun 2010 22:25:53 -0400 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:58084) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORc8V-0003d5-NQ for emacs-orgmode@gnu.org; Wed, 23 Jun 2010 22:25:51 -0400 In-Reply-To: <87hbktusex.fsf@gollum.intra.norang.ca> (Bernt Hansen's message of "Wed\, 23 Jun 2010 21\:32\:22 -0400") 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 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 (# # # ... ^^^^^^^^^^^^^^^^^^^^^^^ 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