Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
a15d166249 | |||
7084fafaa4 | |||
d1c024fdf9 | |||
e0f6ba27a8 | |||
fdaeb1fddb | |||
d5b6b5b355 | |||
4ecd41b934 | |||
c0331b4879 | |||
2a595780b3 | |||
10b5195f1b | |||
![]() |
8331e01908 |
Binary file not shown.
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Binary file not shown.
@ -2,7 +2,7 @@
|
||||
;;
|
||||
;; Author: Jessie Hildebrandt <jessieh.net>
|
||||
;; Homepage: https://gitlab.com/jessieh/mood-line
|
||||
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
|
||||
;;; Commentary:
|
||||
|
@ -3,7 +3,7 @@
|
||||
;; Author: Alynx Zhou <alynx.zhou@gmail.com>
|
||||
;; Jessie Hildebrandt <jessieh.net>
|
||||
;; Homepage: https://gitlab.com/jessieh/mood-line
|
||||
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
|
||||
;;; Commentary:
|
||||
|
@ -3,7 +3,7 @@
|
||||
;; Author: trevDev() <trev@trevdev.ca>
|
||||
;; Jessie Hildebrandt <jessieh.net>
|
||||
;; Homepage: https://gitlab.com/jessieh/mood-line
|
||||
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
|
||||
;;; Commentary:
|
||||
@ -107,6 +107,16 @@ e.g., (:foreground \"red\")."
|
||||
(concat (propertize (car mode-cons)
|
||||
'face (cdr mode-cons))))))
|
||||
|
||||
;; ---------------------------------- ;;
|
||||
;; Xah segment
|
||||
;; ---------------------------------- ;;
|
||||
|
||||
(defun mood-line-segment-modal--xah-fn ()
|
||||
"Display the current xah-fly-keys state."
|
||||
(if (bound-and-true-p xah-fly-insert-state-p)
|
||||
"<I>"
|
||||
"<C>"))
|
||||
|
||||
;; ---------------------------------- ;;
|
||||
;; God segment
|
||||
;; ---------------------------------- ;;
|
||||
|
@ -2,7 +2,7 @@
|
||||
;;
|
||||
;; Author: Jessie Hildebrandt <jessieh.net>
|
||||
;; Homepage: https://gitlab.com/jessieh/mood-line
|
||||
|
||||
;;
|
||||
;; This file is not part of GNU Emacs.
|
||||
|
||||
;;; Commentary:
|
||||
|
27
mood-line.el
27
mood-line.el
@ -220,6 +220,7 @@ An optional key :padding may be provided, the value of which will be used as
|
||||
((or (mood-line-segment-buffer-status)
|
||||
(mood-line-segment-client)
|
||||
" ") . " ")
|
||||
((mood-line-segment-project) . "/")
|
||||
((mood-line-segment-buffer-name) . " ")
|
||||
((mood-line-segment-anzu) . " ")
|
||||
((mood-line-segment-multiple-cursors) . " ")
|
||||
@ -355,7 +356,7 @@ See `mood-line-defformat' for a helpful formatting macro."
|
||||
:group 'mood-line-faces)
|
||||
|
||||
(defface mood-line-frame-status-client
|
||||
'((t (:inherit shadow :weight normal)))
|
||||
'((t (:inherit mood-line-unimportant)))
|
||||
"Face used for the :frame-client frame status indicator.")
|
||||
|
||||
(defface mood-line-major-mode
|
||||
@ -460,17 +461,22 @@ described in the documentation for `mood-line-format', which see."
|
||||
|
||||
(mood-line--deflazy mood-line-segment-modal--evil-fn)
|
||||
(mood-line--deflazy mood-line-segment-modal--meow-fn)
|
||||
(mood-line--deflazy mood-line-segment-modal--xah-fn)
|
||||
(mood-line--deflazy mood-line-segment-modal--god-fn)
|
||||
|
||||
(defun mood-line-segment-modal ()
|
||||
"Return the correct mode line segment for the first active modal mode found.
|
||||
Modal modes checked, in order: `evil-mode', `meow-mode', `god-mode'."
|
||||
Modal editing modes checked, in order:
|
||||
`evil-mode', `meow-mode', `xah-fly-keys', `god-mode'"
|
||||
(cond
|
||||
((bound-and-true-p evil-mode)
|
||||
(mood-line-segment-modal--evil-fn))
|
||||
((bound-and-true-p meow-mode)
|
||||
(mood-line-segment-modal--meow-fn))
|
||||
((featurep 'god-mode)
|
||||
((bound-and-true-p xah-fly-keys)
|
||||
(mood-line-segment-modal--xah-fn))
|
||||
((or (bound-and-true-p god-local-mode)
|
||||
(bound-and-true-p god-global-mode))
|
||||
(mood-line-segment-modal--god-fn))))
|
||||
|
||||
;; ---------------------------------- ;;
|
||||
@ -521,6 +527,21 @@ Modal modes checked, in order: `evil-mode', `meow-mode', `god-mode'."
|
||||
(propertize (mood-line--get-glyph :frame-client)
|
||||
'face 'mood-line-frame-status-client)))
|
||||
|
||||
;; -------------------------------------------------------------------------- ;;
|
||||
;;
|
||||
;; Project segment
|
||||
;;
|
||||
;; -------------------------------------------------------------------------- ;;
|
||||
|
||||
(defun mood-line-segment-project ()
|
||||
"Return project name from project.el or Projectile, if any."
|
||||
(or
|
||||
(and (fboundp 'project-name)
|
||||
(project-current)
|
||||
(project-name (project-current)))
|
||||
(and (fboundp 'projectile-project-name)
|
||||
(projectile-project-name))))
|
||||
|
||||
;; -------------------------------------------------------------------------- ;;
|
||||
;;
|
||||
;; anzu segment
|
||||
|
@ -34,4 +34,12 @@
|
||||
(should (string= (mood-line-segment-vc--rev "" 'SVN)
|
||||
"???"))))
|
||||
|
||||
(ert-deftest --rev/vc-display-status-nil ()
|
||||
"Name of the VCS backend should be reported when `vc-display-status' is nil."
|
||||
(let ((vc-display-status nil))
|
||||
(should (string= (mood-line-segment-vc--rev " Git:main" 'Git)
|
||||
"Git"))
|
||||
(should (string= (mood-line-segment-vc--rev " Hg:main" 'Hg)
|
||||
"Hg"))))
|
||||
|
||||
;;; mood-line-segment-vc-test.el ends here
|
||||
|
@ -148,7 +148,7 @@
|
||||
(should (string= segments-str "ABC123XYZ"))))
|
||||
|
||||
;; ---------------------------------- ;;
|
||||
;; mood-line---process-format
|
||||
;; mood-line--process-format
|
||||
;; ---------------------------------- ;;
|
||||
|
||||
(ert-deftest --process-format/default ()
|
||||
|
Loading…
Reference in New Issue
Block a user