From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [Patch] org-clock-current-task Date: Wed, 24 Feb 2010 15:43:09 +0100 Message-ID: <26468BB6-A290-4344-ABB9-8DD8E876244A@gmail.com> References: <87tyt6u296.fsf@bzg.ath.cx> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NkISP-00080O-LH for emacs-orgmode@gnu.org; Wed, 24 Feb 2010 09:43:21 -0500 Received: from [140.186.70.92] (port=33602 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkISM-0007vs-W9 for emacs-orgmode@gnu.org; Wed, 24 Feb 2010 09:43:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NkISI-0008Av-Rx for emacs-orgmode@gnu.org; Wed, 24 Feb 2010 09:43:18 -0500 Received: from mail-ew0-f212.google.com ([209.85.219.212]:54423) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NkISI-0008Ap-Lh for emacs-orgmode@gnu.org; Wed, 24 Feb 2010 09:43:14 -0500 Received: by ewy4 with SMTP id 4so877124ewy.8 for ; Wed, 24 Feb 2010 06:43:13 -0800 (PST) In-Reply-To: <87tyt6u296.fsf@bzg.ath.cx> 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: Bastien Cc: emacs-orgmode@gnu.org Yes, please go ahead. Thanks. - Carsten On Feb 24, 2010, at 3:39 PM, Bastien wrote: > This patch creates `org-clock-current-task', a new variable to access > the name of the task currently clocked in. > > I use it together with erc-bot.el to let people ask me what I'm doing > right now (either from BitlBee/IRC). > > Shall I push it? > > diff --git a/lisp/org-clock.el b/lisp/org-clock.el > index e3866be..fb6fd01 100644 > --- a/lisp/org-clock.el > +++ b/lisp/org-clock.el > @@ -944,6 +944,7 @@ the clocking selection, associated with the > letter `d'." > (org-back-to-heading t) > (or interrupting (move-marker org-clock-interrupted-task nil)) > (org-clock-history-push) > + (org-clock-set-current) > (cond ((functionp org-clock-in-switch-to-state) > (looking-at org-complex-heading-regexp) > (let ((newstate (funcall org-clock-in-switch-to-state > @@ -1042,6 +1043,11 @@ the clocking selection, associated with the > letter `d'." > (message "Clock starts at %s - %s" ts msg-extra) > (run-hooks 'org-clock-in-hook))))))) > > +(defvar org-clock-current-task nil > + "Task currently clocked in.") > +(defun org-clock-set-current () > + (setq org-clock-current-task (org-get-heading))) > + > (defun org-clock-mark-default-task () > "Mark current task as default task." > (interactive) > > -- > Bastien > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - Carsten