diff options
author | Bastien Guerry <bzg@altern.org> | 2012-07-06 12:54:43 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2012-07-06 12:54:43 +0200 |
commit | 9780de8b3018b3cd46e0d921fdcffd936fd6a53b (patch) | |
tree | caf57005eeda0a0e4ea2ff05fefc167b54b2d2b5 | |
parent | 8dd8540f5534d7bb5384603b4db442c233bdd979 (diff) | |
download | org-mode-9780de8b3018b3cd46e0d921fdcffd936fd6a53b.tar.gz |
org-clock.el (org-clock-in-last): New command.
* org-clock.el (org-clock-in-last): New command.
This autoloaded command provides a way to clock in the last clocked
item stored in `org-clock-history' from any buffer. This is handy
when you don't want to go back to your .org file to clock into the
last clocked task.
-rw-r--r-- | lisp/org-clock.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el index ca85594..b06eafb 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1235,6 +1235,17 @@ the clocking selection, associated with the letter `d'." (message "Clock starts at %s - %s" ts msg-extra) (run-hooks 'org-clock-in-hook))))))) +;;;###autoload +(defun org-clock-in-last (&optional arg) + "Clock in the last closed clocked item. +When already clocking in, send an warning." + (interactive "P") + (if arg (org-clock-select-task) + (org-clock-clock-in (cons (car org-clock-history) (current-time))) + (message "Now clocking in: %s (in %s)" + org-clock-current-task + (buffer-name (marker-buffer org-clock-marker))))) + (defun org-clock-mark-default-task () "Mark current task as default task." (interactive) |