The following code puts an overlay with red bold face on the running clock whenever you call org-clock-in
. It removes the overlay when you call org-clock-out
.
I am not entirely sure whether that is the right thing for you since the LOGBOOK
drawer is not shown by default.
But the code could easily be adapted such that the overlay is put on the heading with running clock.
(require 'org-element)
(require 'org-clock)
(defvar org-clock-running-ol nil
"Overlay for the running clock.")
(defface org-clock-running-face
'((t :foreground "Red" :weight bold))
"Face for highlighting the running clock.")
(defun org-clock-add-running-ol ()
"Highlight the running clock."
(save-excursion
(when (org-clock-is-active)
(org-clock-remove-running-ol)
(goto-char org-clock-marker)
(setq org-clock-running-ol (make-overlay (point) (scan-sexps (point) -1)))
(overlay-put org-clock-running-ol 'face 'org-clock-running-face)
)))
(defun org-clock-remove-running-ol ()
(when (overlayp org-clock-running-ol)
(delete-overlay org-clock-running-ol)
(setq org-clock-running-ol nil)))
(add-hook 'org-clock-in-hook #'org-clock-add-running-ol)
(add-hook 'org-clock-out-hook #'org-clock-remove-running-ol)