From c2834c351160b8f2c5e68b327b07758a5033137d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 28 Apr 2022 15:49:42 -0500 Subject: Make hiding tracking-mode-line when clocked in configurable --- init.el | 5 ++++- lisp/+tab-bar.el | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index 2137179..cfa7f9c 100644 --- a/init.el +++ b/init.el @@ -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 diff --git a/lisp/+tab-bar.el b/lisp/+tab-bar.el index 2c39dae..dce84d8 100644 --- a/lisp/+tab-bar.el +++ b/lisp/+tab-bar.el @@ -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) -- cgit 1.4.1-21-gabe81