* mood-line.el: Added meow-edit support
This commit is contained in:
parent
855ea2760e
commit
fe26101881
28
mood-line.el
28
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
|
:value-type
|
||||||
(cons (string :tag "Display Text") (choice :tag "Face" face plist))))
|
(cons (string :tag "Display Text") (choice :tag "Face" face plist))))
|
||||||
|
|
||||||
|
(defcustom mood-line-meow-state-alist
|
||||||
|
'((normal . ("<N>" . font-lock-variable-name-face))
|
||||||
|
(insert . ("<I>" . font-lock-string-face))
|
||||||
|
(keypad . ("<K>" . font-lock-keyword-face))
|
||||||
|
(beacon . ("<B>" . font-lock-type-face))
|
||||||
|
(motion . ("<M>" . 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
|
(defface mood-line-buffer-name
|
||||||
'((t (:inherit (mode-line-buffer-id))))
|
'((t (:inherit (mode-line-buffer-id))))
|
||||||
"Face used for major mode indicator in the mode-line."
|
"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)))
|
(let ((mode-cons (alist-get evil-state mood-line-evil-state-alist)))
|
||||||
(concat (propertize (car mode-cons) 'face (cdr mode-cons)) " "))))
|
(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 ()
|
(defun mood-line--modal-editing-p ()
|
||||||
"Determine if modal editing is being used."
|
"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
|
;; 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)
|
(:eval (if (mood-line--modal-editing-p)
|
||||||
(progn
|
(progn
|
||||||
(mood-line-segment-evil))
|
(mood-line-segment-evil)
|
||||||
|
(mood-line-segment-meow))
|
||||||
(mood-line-segment-modified)))
|
(mood-line-segment-modified)))
|
||||||
(:eval (mood-line-segment-buffer-name))
|
(:eval (mood-line-segment-buffer-name))
|
||||||
(:eval (if (mood-line--modal-editing-p)
|
(:eval (if (mood-line--modal-editing-p)
|
||||||
|
Loading…
Reference in New Issue
Block a user