emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [Patch] org-clock-current-task
@ 2010-02-24 14:39 Bastien
  2010-02-24 14:43 ` Carsten Dominik
  0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2010-02-24 14:39 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 240 bytes --]

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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-clock.el.diff --]
[-- Type: text/x-diff, Size: 958 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
 Bastien

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-02-24 15:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-24 14:39 [Patch] org-clock-current-task Bastien
2010-02-24 14:43 ` Carsten Dominik
2010-02-24 14:59   ` Bastien
2010-02-24 15:03     ` Carsten Dominik
2010-02-24 15:31       ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).