Compare commits

...

6 Commits

7 changed files with 32 additions and 8 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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
@ -474,8 +475,8 @@ Modal editing modes checked, in order:
(mood-line-segment-modal--meow-fn))
((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))
((or (bound-and-true-p god-local-mode)
(bound-and-true-p god-global-mode))
(mood-line-segment-modal--god-fn))))
;; ---------------------------------- ;;
@ -526,6 +527,21 @@ Modal editing modes checked, in order:
(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

View File

@ -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

View File

@ -148,7 +148,7 @@
(should (string= segments-str "ABC123XYZ"))))
;; ---------------------------------- ;;
;; mood-line---process-format
;; mood-line--process-format
;; ---------------------------------- ;;
(ert-deftest --process-format/default ()