minmo : all calls in mode-line-format should be a func

This commit is contained in:
bth 2026-05-27 12:04:41 -07:00
commit 527642af44

View file

@ -149,6 +149,12 @@ Uses the fast `vc-state' cache rather than synchronous git calls."
(t (minmo--status 'unmodified 'disk)) (t (minmo--status 'unmodified 'disk))
)) ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; buffer-name
(defun minmo-buffer-name ()
(propertize (buffer-name) 'face 'font-lock-string-face))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; major-mode ;;; major-mode
@ -187,6 +193,8 @@ Uses the fast `vc-state' cache rather than synchronous git calls."
(concat " " (project-name project))) (concat " " (project-name project)))
)) ))
(defun minmo-project () minmo--project-cache)
(add-hook 'find-file-hook #'minmo--cache-project) (add-hook 'find-file-hook #'minmo--cache-project)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -244,19 +252,18 @@ Updates only on file load and save to guarantee zero redisplay lag.")
(defvar minmo-minor-modes-face 'font-lock-keyword-face) (defvar minmo-minor-modes-face 'font-lock-keyword-face)
(defun minmo-minor-modes () (defun minmo-minor-modes ()
(string-join (concat (string-join
(delq nil (mapcar (lambda (m) (delq nil (mapcar (lambda (m)
;; NOTE: bound-and-true-p does not work here, because ;; NOTE: bound-and-true-p does not work here, because
;; it's a macro which doesn't evaluate its arguments, ;; it's a macro which doesn't evaluate its arguments,
;; whereas boundp and symbol-value are functions which resolve ;; whereas boundp and symbol-value are functions which resolve
;; the local m var first: ;; the local m var first:
(when (and (boundp m) (symbol-value m)) (when (and (boundp m) (symbol-value m))
;; don't use the :lighter from minor-mode-alist, just strip the end: ;; don't use the :lighter from minor-mode-alist, just strip the end:
(propertize (string-trim-right (symbol-name m) "-minor-mode\\|-mode\\|--managed-mode") (propertize (string-trim-right (symbol-name m) "-minor-mode\\|-mode\\|--managed-mode")
'face minmo-minor-modes-face))) 'face minmo-minor-modes-face)))
minmo-minor-modes-to-show)) minmo-minor-modes-to-show))
" ")) " ") " "))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; truncate ;;; truncate
@ -278,7 +285,7 @@ Updates only on file load and save to guarantee zero redisplay lag.")
;;;;;;;;;;;;; ;;;;;;;;;;;;;
;; (buffer-name) ;; (buffer-name)
'(:eval (propertize "%b" 'face 'font-lock-string-face)) '(:eval (minmo-buffer-name))
;;;;;;;;;;;;; ;;;;;;;;;;;;;
;; major-mode ;; major-mode
@ -286,7 +293,7 @@ Updates only on file load and save to guarantee zero redisplay lag.")
;;;;;;;;;;;;; ;;;;;;;;;;;;;
;; project ;; project
'(:eval minmo--project-cache) '(:eval (minmo-project))
;;;;;;;;;;;;; ;;;;;;;;;;;;;
;; status ;; status
@ -299,7 +306,7 @@ Updates only on file load and save to guarantee zero redisplay lag.")
;;;;;;;;;;;;; ;;;;;;;;;;;;;
;; minor modes ;; minor modes
'(:eval (minmo-minor-modes)) " " '(:eval (minmo-minor-modes))
;;;;;;;;;;;;; ;;;;;;;;;;;;;
;; keycast ;; keycast