Make hiding tracking-mode-line when clocked in configurable

This commit is contained in:
Case Duckworth 2022-04-28 15:49:42 -05:00
parent 7f7ede201b
commit c2834c3511
2 changed files with 10 additions and 2 deletions

View File

@ -1214,7 +1214,8 @@ They are completed by \"M-x TAB\" only in Tramp debug buffers."
(:with-mode tracking-mode
(:option tracking-position 'before-modes)
(:bind "C-c C-SPC" (lambda () (interactive)
(if (and (fboundp 'org-clocking-p)
(if (and +tracking-hide-when-org-clocking
(fboundp 'org-clocking-p)
(org-clocking-p))
(message "Bro, get back to work!")
(call-interactively #'tracking-next-buffer))))
@ -1819,6 +1820,8 @@ See also `crux-reopen-as-root-mode'."
(let ((hook (intern (format "%s-hook" mode))))
(add-hook hook #'visual-fill-column-mode)))
(add-hook 'jabber-activity-mode-hook #'tracking-mode)
(with-eval-after-load 'tracking
(add-to-list 'tracking-ignored-buffers "discuss@conference.soprani.ca"))
(:with-mode jabber-chat-mode
(:local-set +modeline-position-function (lambda ()
(cond

View File

@ -23,12 +23,17 @@
(format-mode-line mode-line-misc-info))
ignore)))
(defcustom +tracking-hide-when-org-clocking nil
"Hide the `tracking-mode' information when clocked in."
:type 'boolean)
(defun +tab-bar-tracking-mode ()
"Display `tracking-mode-line-buffers' in the tab-bar."
;; TODO: write something to convert a mode-line construct to a tab-bar
;; construct.
(when (and tracking-mode
(not (bound-and-true-p org-clock-current-task)))
(not (and +tracking-hide-when-org-clocking
(bound-and-true-p org-clock-current-task))))
(cons (when (> (length tracking-mode-line-buffers) 0)
'(track-mode-line-separator menu-item " " ignore))
(cl-loop for i from 0 below (length tracking-mode-line-buffers)