diff --git a/mood-line.el b/mood-line.el index d2dc871..a4cdbfe 100644 --- a/mood-line.el +++ b/mood-line.el @@ -104,6 +104,21 @@ The `Face' may be either a face symbol or a property list of key-value pairs :value-type (cons (string :tag "Display Text") (choice :tag "Face" face plist)))) +(defcustom mood-line-meow-state-alist + '((normal . ("" . font-lock-variable-name-face)) + (insert . ("" . font-lock-string-face)) + (keypad . ("" . font-lock-keyword-face)) + (beacon . ("" . font-lock-type-face)) + (motion . ("" . font-lock-constant-face))) + "Set the string and corresponding face for any `meow-mode' state. +The `Face' may be either a face symbol or a property list of key-value pairs + e.g. (:foreground \"red\")." + :group 'mood-line + :type '(alist + :key-type symbol + :value-type + (cons (string :tag "Display Text") (choice :tag "Face" face plist)))) + (defface mood-line-buffer-name '((t (:inherit (mode-line-buffer-id)))) "Face used for major mode indicator in the mode-line." @@ -326,9 +341,17 @@ The `Face' may be either a face symbol or a property list of key-value pairs (let ((mode-cons (alist-get evil-state mood-line-evil-state-alist))) (concat (propertize (car mode-cons) 'face (cdr mode-cons)) " ")))) +(defun mood-line-segment-meow () + (when meow--current-state + (let ((mode-cons (alist-get + meow--current-state + mood-line-meow-state-alist))) + (concat (propertize (car mode-cons) 'face (cdr mode-cons)) " ")))) + (defun mood-line--modal-editing-p () "Determine if modal editing is being used." - (or (bound-and-true-p evil-mode))) ; (or) is for future modal additions. + (or (bound-and-true-p evil-mode) + (bound-and-true-p meow-mode))) ;; ;; Activation function @@ -372,7 +395,8 @@ The `Face' may be either a face symbol or a property list of key-value pairs '(" " (:eval (if (mood-line--modal-editing-p) (progn - (mood-line-segment-evil)) + (mood-line-segment-evil) + (mood-line-segment-meow)) (mood-line-segment-modified))) (:eval (mood-line-segment-buffer-name)) (:eval (if (mood-line--modal-editing-p)