diff options
Diffstat (limited to 'lisp/+tab-bar.el')
-rw-r--r-- | lisp/+tab-bar.el | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/lisp/+tab-bar.el b/lisp/+tab-bar.el index f143388..83870e9 100644 --- a/lisp/+tab-bar.el +++ b/lisp/+tab-bar.el | |||
@@ -19,10 +19,34 @@ | |||
19 | 19 | ||
20 | (defun +tab-bar-misc-info () | 20 | (defun +tab-bar-misc-info () |
21 | "Display `mode-line-misc-info', formatted for the tab-bar." | 21 | "Display `mode-line-misc-info', formatted for the tab-bar." |
22 | `((global menu-item ,(string-trim-right | 22 | `((misc-info menu-item ,(string-trim-right |
23 | (format-mode-line mode-line-misc-info)) | 23 | (format-mode-line mode-line-misc-info)) |
24 | 24 | ignore))) | |
25 | ignore :help (discord-date-string)))) | 25 | |
26 | (defun +tab-bar-tracking-mode () | ||
27 | "Display `tracking-mode-line-buffers' in the tab-bar." | ||
28 | ;; TODO: write something to convert a mode-line construct to a tab-bar | ||
29 | ;; construct. | ||
30 | (when tracking-mode | ||
31 | (cl-loop for i from 0 below (length tracking-mode-line-buffers) | ||
32 | as item = (nth i tracking-mode-line-buffers) | ||
33 | collect (append (list (intern (format "tracking-mode-line-%s" i)) | ||
34 | 'menu-item | ||
35 | (format-mode-line item)) | ||
36 | (if-let ((keymap (plist-get item 'keymap))) | ||
37 | (list (alist-get 'down-mouse-1 (cdadr keymap))) | ||
38 | (list #'ignore)) | ||
39 | (when-let ((help (plist-get item 'help-echo))) | ||
40 | (list :help help)))))) | ||
41 | |||
42 | (defun +tab-bar-date () | ||
43 | "Display `display-time-string' in the tab-bar." | ||
44 | (when display-time-mode | ||
45 | `((date-time-string menu-item | ||
46 | ,(propertize display-time-string | ||
47 | 'face 'font-lock-comment-face) | ||
48 | ignore | ||
49 | :help (discord-date-string))))) | ||
26 | 50 | ||
27 | (defvar +tab-bar-show-original nil | 51 | (defvar +tab-bar-show-original nil |
28 | "Original value of `tab-bar-show'.") | 52 | "Original value of `tab-bar-show'.") |