org-clock.el (org-clock-jump-to-current-clock): Tiny enhancements

* lisp/org-clock.el (org-clock-jump-to-current-clock): Add a
docstring, do not use as a command and throw a user error
instead of an error when no clock is active.
This commit is contained in:
Bastien 2018-04-28 12:23:26 +02:00
parent 65d70388ab
commit 1933d9ef26
1 changed files with 2 additions and 2 deletions

View File

@ -949,12 +949,12 @@ If necessary, clock-out of the currently active clock."
resolve-to))))))))
(defun org-clock-jump-to-current-clock (&optional effective-clock)
(interactive)
"When an Org clock is running, jump to it."
(let ((drawer (org-clock-into-drawer))
(clock (or effective-clock (cons org-clock-marker
org-clock-start-time))))
(unless (marker-buffer (car clock))
(error "No clock is currently running"))
(user-error "No Org clock is currently running"))
(org-with-clock clock (org-clock-goto))
(with-current-buffer (marker-buffer (car clock))
(goto-char (car clock))