Selaa lähdekoodia

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.
Bastien Guerry 13 vuotta sitten
vanhempi
commit
9780de8b30
1 muutettua tiedostoa jossa 11 lisäystä ja 0 poistoa
  1. 11 0
      lisp/org-clock.el

+ 11 - 0
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)