emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] [Patch] org-clock-current-task


From: Carsten Dominik
Subject: Re: [Orgmode] [Patch] org-clock-current-task
Date: Wed, 24 Feb 2010 15:43:09 +0100

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.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten







reply via email to

[Prev in Thread] Current Thread [Next in Thread]