summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-04-28 15:49:42 -0500
committerCase Duckworth2022-04-28 15:49:42 -0500
commitc2834c351160b8f2c5e68b327b07758a5033137d (patch)
tree945dc6aa6bbeff0f5b7ac56b29860da23aca8645
parentDim .gitignore files (mostly) in dired (diff)
downloademacs-c2834c351160b8f2c5e68b327b07758a5033137d.tar.gz
emacs-c2834c351160b8f2c5e68b327b07758a5033137d.zip
Make hiding tracking-mode-line when clocked in configurable
-rw-r--r--init.el5
-rw-r--r--lisp/+tab-bar.el7
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."
1214 (:with-mode tracking-mode 1214 (:with-mode tracking-mode
1215 (:option tracking-position 'before-modes) 1215 (:option tracking-position 'before-modes)
1216 (:bind "C-c C-SPC" (lambda () (interactive) 1216 (:bind "C-c C-SPC" (lambda () (interactive)
1217 (if (and (fboundp 'org-clocking-p) 1217 (if (and +tracking-hide-when-org-clocking
1218 (fboundp 'org-clocking-p)
1218 (org-clocking-p)) 1219 (org-clocking-p))
1219 (message "Bro, get back to work!") 1220 (message "Bro, get back to work!")
1220 (call-interactively #'tracking-next-buffer)))) 1221 (call-interactively #'tracking-next-buffer))))
@@ -1819,6 +1820,8 @@ See also `crux-reopen-as-root-mode'."
1819 (let ((hook (intern (format "%s-hook" mode)))) 1820 (let ((hook (intern (format "%s-hook" mode))))
1820 (add-hook hook #'visual-fill-column-mode))) 1821 (add-hook hook #'visual-fill-column-mode)))
1821 (add-hook 'jabber-activity-mode-hook #'tracking-mode) 1822 (add-hook 'jabber-activity-mode-hook #'tracking-mode)
1823 (with-eval-after-load 'tracking
1824 (add-to-list 'tracking-ignored-buffers "discuss@conference.soprani.ca"))
1822 (:with-mode jabber-chat-mode 1825 (:with-mode jabber-chat-mode
1823 (:local-set +modeline-position-function (lambda () 1826 (:local-set +modeline-position-function (lambda ()
1824 (cond 1827 (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 @@
23 (format-mode-line mode-line-misc-info)) 23 (format-mode-line mode-line-misc-info))
24 ignore))) 24 ignore)))
25 25
26(defcustom +tracking-hide-when-org-clocking nil
27 "Hide the `tracking-mode' information when clocked in."
28 :type 'boolean)
29
26(defun +tab-bar-tracking-mode () 30(defun +tab-bar-tracking-mode ()
27 "Display `tracking-mode-line-buffers' in the tab-bar." 31 "Display `tracking-mode-line-buffers' in the tab-bar."
28 ;; TODO: write something to convert a mode-line construct to a tab-bar 32 ;; TODO: write something to convert a mode-line construct to a tab-bar
29 ;; construct. 33 ;; construct.
30 (when (and tracking-mode 34 (when (and tracking-mode
31 (not (bound-and-true-p org-clock-current-task))) 35 (not (and +tracking-hide-when-org-clocking
36 (bound-and-true-p org-clock-current-task))))
32 (cons (when (> (length tracking-mode-line-buffers) 0) 37 (cons (when (> (length tracking-mode-line-buffers) 0)
33 '(track-mode-line-separator menu-item " " ignore)) 38 '(track-mode-line-separator menu-item " " ignore))
34 (cl-loop for i from 0 below (length tracking-mode-line-buffers) 39 (cl-loop for i from 0 below (length tracking-mode-line-buffers)