minmo : all calls in mode-line-format should be a func
This commit is contained in:
parent
571dc90435
commit
527642af44
1 changed files with 23 additions and 16 deletions
|
|
@ -149,6 +149,12 @@ Uses the fast `vc-state' cache rather than synchronous git calls."
|
|||
(t (minmo--status 'unmodified 'disk))
|
||||
))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; buffer-name
|
||||
|
||||
(defun minmo-buffer-name ()
|
||||
(propertize (buffer-name) 'face 'font-lock-string-face))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; major-mode
|
||||
|
||||
|
|
@ -187,6 +193,8 @@ Uses the fast `vc-state' cache rather than synchronous git calls."
|
|||
(concat " " (project-name project)))
|
||||
))
|
||||
|
||||
(defun minmo-project () minmo--project-cache)
|
||||
|
||||
(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)
|
||||
|
||||
(defun minmo-minor-modes ()
|
||||
(string-join
|
||||
(delq nil (mapcar (lambda (m)
|
||||
;; NOTE: bound-and-true-p does not work here, because
|
||||
;; it's a macro which doesn't evaluate its arguments,
|
||||
;; whereas boundp and symbol-value are functions which resolve
|
||||
;; the local m var first:
|
||||
(when (and (boundp m) (symbol-value m))
|
||||
;; 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")
|
||||
'face minmo-minor-modes-face)))
|
||||
minmo-minor-modes-to-show))
|
||||
" "))
|
||||
|
||||
(concat (string-join
|
||||
(delq nil (mapcar (lambda (m)
|
||||
;; NOTE: bound-and-true-p does not work here, because
|
||||
;; it's a macro which doesn't evaluate its arguments,
|
||||
;; whereas boundp and symbol-value are functions which resolve
|
||||
;; the local m var first:
|
||||
(when (and (boundp m) (symbol-value m))
|
||||
;; 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")
|
||||
'face minmo-minor-modes-face)))
|
||||
minmo-minor-modes-to-show))
|
||||
" ") " "))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;; truncate
|
||||
|
|
@ -278,7 +285,7 @@ Updates only on file load and save to guarantee zero redisplay lag.")
|
|||
|
||||
;;;;;;;;;;;;;
|
||||
;; (buffer-name)
|
||||
'(:eval (propertize "%b" 'face 'font-lock-string-face))
|
||||
'(:eval (minmo-buffer-name))
|
||||
|
||||
;;;;;;;;;;;;;
|
||||
;; major-mode
|
||||
|
|
@ -286,7 +293,7 @@ Updates only on file load and save to guarantee zero redisplay lag.")
|
|||
|
||||
;;;;;;;;;;;;;
|
||||
;; project
|
||||
'(:eval minmo--project-cache)
|
||||
'(:eval (minmo-project))
|
||||
|
||||
;;;;;;;;;;;;;
|
||||
;; status
|
||||
|
|
@ -299,7 +306,7 @@ Updates only on file load and save to guarantee zero redisplay lag.")
|
|||
|
||||
;;;;;;;;;;;;;
|
||||
;; minor modes
|
||||
'(:eval (minmo-minor-modes)) " "
|
||||
'(:eval (minmo-minor-modes))
|
||||
|
||||
;;;;;;;;;;;;;
|
||||
;; keycast
|
||||
|
|
|
|||
Loading…
Reference in a new issue