[Org] Provide function to set frame title from current clock

This commit is contained in:
Daniel - 2019-08-31 11:26:04 +02:00
parent 541851ed00
commit 44e6818abb
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
2 changed files with 11 additions and 1 deletions

View File

@ -643,6 +643,7 @@ search commands like `db/helm-shortcuts."
db/find-parent-task
db/ensure-running-clock
db/save-current-org-task-to-file
db/org-update-frame-title-with-current-clock
db/org-clock-out
db/org-clock-in-break-task
db/org-clock-in-home-task
@ -885,6 +886,7 @@ search commands like `db/helm-shortcuts."
(org-clock-persistence-insinuate)
(add-hook 'org-clock-in-hook #'db/org-mark-current-default-task)
(add-hook 'org-clock-in-hook #'db/org-update-frame-title-with-current-clock)
;; Clock in default task if no other task is given
(add-hook 'org-clock-out-hook #'db/ensure-running-clock 'append)

View File

@ -262,7 +262,7 @@ In ~%s~:
(org-reset-checkbox-state-subtree)))
;; Helper Functions for Clocking
;;; Helper Functions for Clocking
(defun db/find-parent-task ()
;; http://doc.norang.ca/org-mode.html#Clocking
@ -308,6 +308,14 @@ In ~%s~:
(insert "No running clock")
(insert org-clock-heading)))))
(defun db/org-update-frame-title-with-current-clock ()
"Set the frametitle of the current frame to the headline of the
current task."
(interactive)
(let ((clock-buffer (marker-buffer org-clock-marker)))
(when clock-buffer
(modify-frame-parameters nil `((name . , org-clock-heading))))))
;;; Fixes