From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: [Accepted] Fix J in agenda when clock out hook clocks in again Date: Sun, 12 Feb 2012 19:48:27 +0100 (CET) Message-ID: <20120212184827.380DED45@w500.ictsoc.de> References: <1328809420-31933-1-git-send-email-bernt@norang.ca> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:48832) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RweTO-0006A9-Jq for emacs-orgmode@gnu.org; Sun, 12 Feb 2012 13:48:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RweTN-0005TD-6y for emacs-orgmode@gnu.org; Sun, 12 Feb 2012 13:48:30 -0500 Received: from app1a.xlhost.de ([213.202.242.161]:36145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RweTN-0005T7-0w for emacs-orgmode@gnu.org; Sun, 12 Feb 2012 13:48:29 -0500 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: emacs-orgmode@gnu.org Patch 1160 (http://patchwork.newartisans.com/patch/1160/) is now "Accepted". Maintainer comment: none This relates to the following submission: http://mid.gmane.org/%3C1328809420-31933-1-git-send-email-bernt%40norang.ca%3E Here is the original message containing the patch: > Content-Type: text/plain; charset="utf-8" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Subject: [O] Fix J in agenda when clock out hook clocks in again > Date: Thu, 09 Feb 2012 22:43:40 -0000 > From: Bernt Hansen > X-Patchwork-Id: 1160 > Message-Id: <1328809420-31933-1-git-send-email-bernt@norang.ca> > To: emacs-orgmode@gnu.org > Cc: Bernt Hansen > > * org-clock.el (org-clock-out): Do not delete the current clocking task > when org-clock-out-hook clocks in another task > > My clock out hook keeps the clock running by automatically clocking in > a new task (the parent task, or the default task). This sets a new > clocking task which was then clobbered at the end of org-clock-out > so that J in the agenda would return > > "No running clock, use `C-c C-x C-j' to jump to the most recent one" > > We now detect that another task is clocked in and skip clearing the > org-clock-current-task variable used by the agenda to determine if > the clock is currently running. > > --- > lisp/org-clock.el | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/lisp/org-clock.el b/lisp/org-clock.el > index a1df776..7dff094 100644 > --- a/lisp/org-clock.el > +++ b/lisp/org-clock.el > @@ -1387,7 +1387,8 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set." > (message (concat "Clock stopped at %s after HH:MM = " org-time-clocksum-format "%s") te h m > (if remove " => LINE REMOVED" "")) > (run-hooks 'org-clock-out-hook) > - (org-clock-delete-current)))))) > + (unless (org-clocking-p) > + (org-clock-delete-current))))))) > > (add-hook 'org-clock-out-hook 'org-clock-remove-empty-clock-drawer) > >