From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: [Patch] org-clock-current-task Date: Wed, 24 Feb 2010 15:39:17 +0100 Message-ID: <87tyt6u296.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NkIOd-0004QL-LU for emacs-orgmode@gnu.org; Wed, 24 Feb 2010 09:39:27 -0500 Received: from [140.186.70.92] (port=50515 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkIOc-0004PL-Qd for emacs-orgmode@gnu.org; Wed, 24 Feb 2010 09:39:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NkIOc-0007ef-0o for emacs-orgmode@gnu.org; Wed, 24 Feb 2010 09:39:26 -0500 Received: from mail-pw0-f41.google.com ([209.85.160.41]:48987) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NkIOb-0007eV-S8 for emacs-orgmode@gnu.org; Wed, 24 Feb 2010 09:39:25 -0500 Received: by pwj7 with SMTP id 7so5006234pwj.0 for ; Wed, 24 Feb 2010 06:39:24 -0800 (PST) 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 --=-=-= 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? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=org-clock.el.diff 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 --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --=-=-=--