From 9784af675c40d7d2b20179d9ae09dc4183055662 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Mon, 7 Mar 2011 17:25:00 +0100 Subject: [PATCH] Fix bug with the handling of the new :clock-keep option. Thanks to Bernt for the detailed report. --- lisp/org-capture.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index e5cdea220..72ca2b2ed 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -460,7 +460,7 @@ bypassed." (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 @@ bypassed." (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 @@ process should clock-out the captured entry." (> 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 -- 2.11.4.GIT