org-agenda: Fix "Void variable org-clock-current-task"

* lisp/org-agenda.el (org-agenda-mark-clocking-task):
(org-agenda-clock-goto): `org-clock-current-task' may not be defined, so
check that first.

Reported-by: Kyle Meyer <kyle@kyleam.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106504>
This commit is contained in:
Nicolas Goaziou 2016-04-19 21:14:54 +02:00
parent 7894129841
commit dbda42010c
1 changed files with 2 additions and 2 deletions

View File

@ -3801,7 +3801,7 @@ FILTER-ALIST is an alist of filters we need to apply when
"Mark the current clock entry in the agenda if it is present." "Mark the current clock entry in the agenda if it is present."
;; We need to widen when `org-agenda-finalize' is called from ;; We need to widen when `org-agenda-finalize' is called from
;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in') ;; `org-agenda-change-all-lines' (e.g. in `org-agenda-clock-in')
(when org-clock-current-task (when (bound-and-true-p org-clock-current-task)
(save-restriction (save-restriction
(widen) (widen)
(org-agenda-unmark-clocking-task) (org-agenda-unmark-clocking-task)
@ -9407,7 +9407,7 @@ buffer, display it in another window."
(cond (pos (goto-char pos)) (cond (pos (goto-char pos))
;; If the currently clocked entry is not in the agenda ;; If the currently clocked entry is not in the agenda
;; buffer, we visit it in another window: ;; buffer, we visit it in another window:
(org-clock-current-task ((bound-and-true-p org-clock-current-task)
(org-switch-to-buffer-other-window (org-clock-goto))) (org-switch-to-buffer-other-window (org-clock-goto)))
(t (message "No running clock, use `C-c C-x C-j' to jump to the most recent one"))))) (t (message "No running clock, use `C-c C-x C-j' to jump to the most recent one")))))