Function: org-timer-item
org-timer-item is an autoloaded, interactive and byte-compiled
function defined in org-timer.el.gz.
Signature
(org-timer-item &optional ARG)
Documentation
Insert a description-type item with the current timer value.
Prefix argument ARG is passed to org-timer.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-timer.el.gz
;;;###autoload
(defun org-timer-item (&optional arg)
"Insert a description-type item with the current timer value.
Prefix argument ARG is passed to `org-timer'."
(interactive "P")
(let ((itemp (org-in-item-p)) (pos (point)))
(cond
;; In a timer list, insert with `org-list-insert-item',
;; then fix the list.
((and itemp (goto-char itemp) (org-at-item-timer-p))
(let* ((struct (org-list-struct))
(prevs (org-list-prevs-alist struct))
(s (concat (org-timer (when arg '(4)) t) ":: ")))
(setq struct (org-list-insert-item pos struct prevs nil s))
(org-list-write-struct struct (org-list-parents-alist struct))
(looking-at org-list-full-item-re)
(goto-char (match-end 0))))
;; In a list of another type, don't break anything: throw an error.
(itemp (goto-char pos) (error "This is not a timer list"))
;; Else, start a new list.
(t
(forward-line 0)
(org-indent-line)
(insert "- ")
(org-timer (when arg '(4)))
(insert ":: ")))))