From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Myles English" Subject: [PATCH] Fixing when org-clock-in-prepare-hook is called Date: Fri, 26 Oct 2012 12:47:59 +0100 Message-ID: <87r4olh2ts.fsf@ed.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRiGu-0004Cx-0n for emacs-orgmode@gnu.org; Fri, 26 Oct 2012 07:40:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TRiGl-0005vO-Fu for emacs-orgmode@gnu.org; Fri, 26 Oct 2012 07:40:15 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:60996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TRiGk-0005tp-NB for emacs-orgmode@gnu.org; Fri, 26 Oct 2012 07:40:07 -0400 Received: by mail-wi0-f177.google.com with SMTP id hj13so240801wib.12 for ; Fri, 26 Oct 2012 04:40:05 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org mode >From d7c3f0a4611ced0a240af9115f29f888beb60af2 Mon Sep 17 00:00:00 2001 From: Myles English Date: Fri, 26 Oct 2012 12:38:09 +0100 Subject: [PATCH] Clocking: Move to task before calling org-clock-in-prepare-hook * lisp/org-clock.el (org-clock-in): Moved the call to org-clock-in-prepare-hook until the task's properties can be accessed. The problem was when using a function to add an effort property via the hook, it would not recognise an existing effort property when called with the prefix (C-u C-c C-x C-i) with the point at a place other than at the task. TINYCHANGE --- 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 e5488e4..84eb2fd 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1149,7 +1149,6 @@ make this the default behavior.)" (if (and (eobp) (not (org-at-heading-p))) (point-at-bol 0) (point))) - (run-hooks 'org-clock-in-prepare-hook) (save-excursion (when (and selected-task (marker-buffer selected-task)) ;; There is a selected task, move to the correct buffer @@ -1168,6 +1167,7 @@ make this the default behavior.)" ;; beginning of the heading, since the ;; user is liking to insert stuff here ;; manually + (run-hooks 'org-clock-in-prepare-hook) (org-clock-history-push)) (org-clock-set-current) (cond ((functionp org-clock-in-switch-to-state) -- 1.8.0