From mboxrd@z Thu Jan 1 00:00:00 1970 From: Frederic Couchet Subject: Re: [Bug] [Version 7.5] org-capture : the clock doesn't resume on the original clocking task Date: Mon, 04 Apr 2011 12:17:18 +0200 Message-ID: <874o6egw29.fsf@april.org> References: <871v1ku5wx.fsf@april.org> <878vvsr0wu.fsf@norang.ca> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=43074 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6gqs-0001jf-Nv for emacs-orgmode@gnu.org; Mon, 04 Apr 2011 06:17:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q6gqn-0000Mg-Fk for emacs-orgmode@gnu.org; Mon, 04 Apr 2011 06:17:38 -0400 Received: from lo.gmane.org ([80.91.229.12]:50980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q6gqn-0000LZ-62 for emacs-orgmode@gnu.org; Mon, 04 Apr 2011 06:17:37 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q6gqg-0001mA-GR for emacs-orgmode@gnu.org; Mon, 04 Apr 2011 12:17:30 +0200 Received: from teclibrivoli.pck.nerim.net ([62.212.96.11]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 04 Apr 2011 12:17:30 +0200 Received: from fcouchet by teclibrivoli.pck.nerim.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 04 Apr 2011 12:17:30 +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: emacs-orgmode@gnu.org >>>>> "Bernt" == Bernt Hansen writes: Bernt> Hi Frederic, Bernt> So does this mean it's fixed in origin/master but broken in Bernt> release_7.5? Is your original task in the same file as the Bernt> target of your capture? Yes, it is. Bernt> There were a few fixes to the codebase for clocking after the Bernt> 7.5 release. Ok. That works with the git version, that is the main thing. Here is the diff between the 7.5 version and git version. --- org-7.5/lisp/org-capture.el 2011-03-07 15:29:01.000000000 +0100 +++ org-7.5-git/lisp/org-capture.el 2011-03-30 16:46:41.000000000 +0200 @@ -54,7 +54,7 @@ (require 'org-mks) (declare-function org-datetree-find-date-create "org-datetree" - (DATE &optional KEEP-RESTRICTION)) + (date &optional keep-restriction)) (declare-function org-table-get-specials "org-table" ()) (declare-function org-table-goto-line "org-table" (N)) (defvar org-remember-default-headline) @@ -460,7 +460,7 @@ (org-capture-get :key) (nth 1 error)))) (if (org-capture-get :immediate-finish) - (org-capture-finalize nil (not (org-capture-get :clock-keep))) + (org-capture-finalize nil (org-capture-get :clock-keep)) (if (and (org-mode-p) (org-capture-get :clock-in)) (condition-case nil @@ -491,12 +491,12 @@ (t (setq txt "* Invalid capture template"))) (org-capture-put :template txt))) -(defun org-capture-finalize (&optional stay-with-capture clock-out) +(defun org-capture-finalize (&optional stay-with-capture clock-keep) "Finalize the capture process. With prefix argument STAY-WITH-CAPTURE, jump to the location of the captured item after finalizing. A second optional argument tells whether finalizing the capture -process should clock-out the captured entry." +process should keep the clock running in the filed entry." (interactive "P") (unless (and org-capture-mode (buffer-base-buffer (current-buffer))) @@ -509,8 +509,8 @@ (> org-clock-marker (point-min)) (< org-clock-marker (point-max))) ;; Looks like the clock we started is still running. Clock out. - (when clock-out (let (org-log-note-clock-out) (org-clock-out))) - (when (and clock-out + (when (not clock-keep) (let (org-log-note-clock-out) (org-clock-out))) + (when (and (not clock-keep) (org-capture-get :clock-resume 'local) (markerp (org-capture-get :interrupted-clock 'local)) (buffer-live-p (marker-buffer Librement, Fred.