Преглед на файлове

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 години
родител
ревизия
9780de8b30
променени са 1 файла, в които са добавени 11 реда и са изтрити 0 реда
  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)