Compare commits

...

7 Commits

6 changed files with 72 additions and 47 deletions

View File

@ -40,7 +40,7 @@ If you are a user of `use-package`, it is easy to configure mood-line directly i
;; Use pretty Fira Code-compatible glyphs ;; Use pretty Fira Code-compatible glyphs
:custom :custom
(mood-line-glyph-alist . mood-line-glyphs-fira-code)) (mood-line-glyph-alist mood-line-glyphs-fira-code))
``` ```
### Format ### Format
@ -82,7 +82,7 @@ If you'd like to see prettier Unicode glyphs, you can change the value of `mood-
```elisp ```elisp
;; The default set of glyphs: ;; The default set of glyphs:
;; * myModifiedFile.js Replace*3 + main Javascript ! Issues: 2 ;; * myModifiedFile.js Replace*3 + main JavaScript ! Issues: 2
(setq mood-line-glyph-alist mood-line-glyphs-ascii) (setq mood-line-glyph-alist mood-line-glyphs-ascii)
;; A set of Fira Code-compatible Unicode glyphs: ;; A set of Fira Code-compatible Unicode glyphs:
@ -112,7 +112,7 @@ To run the included tests:
## Feedback ## Feedback
If you experience any issues with this package, please If you experience any issues with this package, please
[open an issue](https://gitlab.com/jessieh/mood-line/issues/new) [open an issue](https://git.tty.dog/jessieh/mood-line/issues/new)
on the issue tracker. on the issue tracker.
Suggestions for improvements and feature requests are always appreciated, as well! Suggestions for improvements and feature requests are always appreciated, as well!

View File

@ -35,7 +35,7 @@
;; -------------------------------------------------------------------------- ;; ;; -------------------------------------------------------------------------- ;;
;; ---------------------------------- ;; ;; ---------------------------------- ;;
;; Compile time requirements ;; Required features
;; ---------------------------------- ;; ;; ---------------------------------- ;;
(eval-when-compile (eval-when-compile
@ -45,19 +45,19 @@
;; External variable defs ;; External variable defs
;; ---------------------------------- ;; ;; ---------------------------------- ;;
(defvar flycheck-current-errors) (eval-when-compile
(defvar flycheck-current-errors))
;; ---------------------------------- ;; ;; ---------------------------------- ;;
;; External function decls ;; External function decls
;; ---------------------------------- ;; ;; ---------------------------------- ;;
(declare-function mood-line--get-glyph "mood-line") (eval-when-compile
(declare-function mood-line--get-glyph "mood-line")
(declare-function flycheck-count-errors "flycheck") (declare-function flycheck-count-errors "flycheck")
(declare-function flymake-running-backends "flymake")
(declare-function flymake-running-backends "flymake") (declare-function flymake-reporting-backends "flymake")
(declare-function flymake-reporting-backends "flymake") (declare-function flymake--lookup-type-property "flymake"))
(declare-function flymake--lookup-type-property "flymake")
;; -------------------------------------------------------------------------- ;; ;; -------------------------------------------------------------------------- ;;
;; ;;

View File

@ -39,7 +39,8 @@
;; External function decls ;; External function decls
;; ---------------------------------- ;; ;; ---------------------------------- ;;
(declare-function mood-line--get-glyph "mood-line") (eval-when-compile
(declare-function mood-line--get-glyph "mood-line"))
;; -------------------------------------------------------------------------- ;; ;; -------------------------------------------------------------------------- ;;
;; ;;

View File

@ -38,7 +38,8 @@
;; External function decls ;; External function decls
;; ---------------------------------- ;; ;; ---------------------------------- ;;
(declare-function mood-line--get-glyph "mood-line") (eval-when-compile
(declare-function mood-line--get-glyph "mood-line"))
;; -------------------------------------------------------------------------- ;; ;; -------------------------------------------------------------------------- ;;
;; ;;

View File

@ -10,8 +10,7 @@
;;; Commentary: ;;; Commentary:
;; ;;
;; mood-line is a minimal mode line configuration that aims to replicate ;; mood-line is a lightweight, drop-in replacement for the default mode line.
;; some of the features of the more advanced doom-modeline package.
;; ;;
;; Features offered: ;; Features offered:
;; * Clean, informative design ;; * Clean, informative design
@ -52,7 +51,7 @@
;; -------------------------------------------------------------------------- ;; ;; -------------------------------------------------------------------------- ;;
;; ---------------------------------- ;; ;; ---------------------------------- ;;
;; Compile time requirements ;; Required features
;; ---------------------------------- ;; ;; ---------------------------------- ;;
(eval-when-compile (eval-when-compile
@ -62,18 +61,19 @@
;; External variable defs ;; External variable defs
;; ---------------------------------- ;; ;; ---------------------------------- ;;
(defvar anzu--cached-count) (eval-when-compile
(defvar anzu--current-position) (defvar anzu--cached-count)
(defvar anzu--overflow-p) (defvar anzu--current-position)
(defvar anzu--total-matched) (defvar anzu--overflow-p)
(defvar anzu--total-matched))
;; ---------------------------------- ;; ;; ---------------------------------- ;;
;; External function decls ;; External function decls
;; ---------------------------------- ;; ;; ---------------------------------- ;;
(declare-function mc/num-cursors "multiple-cursors") (eval-when-compile
(declare-function mc/num-cursors "multiple-cursors")
(declare-function string-blank-p "subr-x") (declare-function string-blank-p "subr-x"))
;; -------------------------------------------------------------------------- ;; ;; -------------------------------------------------------------------------- ;;
;; ;;

View File

@ -17,57 +17,80 @@
;; mood-line-defformat ;; mood-line-defformat
;; ---------------------------------- ;; ;; ---------------------------------- ;;
(ert-deftest -defformat/right-nil () (ert-deftest -defformat/padding ()
"The format sequence should expand if the right segment list is not provided." "The expanded sequence should include the provided (or default) padding."
(should (equal (mood-line-defformat (should (equal (mood-line-defformat)
;; Left
("XYZ")
;; Right
)
(list (list
;; Left ;; Left
'("XYZ") '(" ")
;; Right ;; Right
nil)))) '(" "))))
(ert-deftest -defformat/left-right ()
"The expanded sequence should should include left and right segments lists."
(should (equal (mood-line-defformat (should (equal (mood-line-defformat
:padding
"---")
(list
;; Left ;; Left
("ABC") '("---")
;; Right ;; Right
'("---")))))
(ert-deftest -defformat/left-right-nil ()
"The format sequence should expand if the left or right segment list is nil."
(should (equal (mood-line-defformat
:left
("XYZ")) ("XYZ"))
(list (list
;; Left ;; Left
'("ABC") '(" " "XYZ")
;; Right ;; Right
'("XYZ"))))) '(" "))))
(should (equal (mood-line-defformat
:right
("XYZ"))
(list
;; Left
'(" ")
;; Right
'("XYZ" " ")))))
(ert-deftest -defformat/left-right ()
"The expanded sequence should include left and right segments lists."
(should (equal (mood-line-defformat
:left
("ABC")
:right
("XYZ"))
(list
;; Left
'(" " "ABC")
;; Right
'("XYZ" " ")))))
(ert-deftest -defformat/cons-cells () (ert-deftest -defformat/cons-cells ()
"Cons cell segments should expand into their `car' and `cdr' values." "Cons cell segments should expand into their `car' and `cdr' values."
(should (equal (mood-line-defformat (should (equal (mood-line-defformat
;; Left :left
("ABC" ("ABC" . "XYZ") "XYZ") ("ABC" ("ABC" . "XYZ") "XYZ")
;; Right :right
("..." ((some-fn) . " ") "...")) ("..." ((some-fn) . " ") "..."))
(list (list
;; Left ;; Left
'("ABC" "ABC" "XYZ" "XYZ") '(" " "ABC" "ABC" "XYZ" "XYZ")
;; Right ;; Right
'("..." (some-fn) " " "..."))))) '("..." (some-fn) " " "..." " ")))))
(ert-deftest -defformat/exp-separators () (ert-deftest -defformat/exp-separators ()
"Non-string, non-cons expressions should expand followed by a blank string." "Non-string, non-cons expressions should expand followed by a blank string."
(should (equal (mood-line-defformat (should (equal (mood-line-defformat
;; Left :left
("ABC" ("ABC" . "XYZ") some-exp "XYZ" (some-fn)) ("ABC" ("ABC" . "XYZ") some-exp "XYZ" (some-fn))
;; Right :right
("..." ((some-fn) . " ") (another-fn) "...")) ("..." ((some-fn) . " ") (another-fn) "..."))
(list (list
;; Left ;; Left
'("ABC" "ABC" "XYZ" some-exp "" "XYZ" (some-fn) "") '(" " "ABC" "ABC" "XYZ" some-exp "" "XYZ" (some-fn) "")
;; Right ;; Right
'("..." (some-fn) " " (another-fn) "" "..."))))) '("..." (some-fn) " " (another-fn) "" "..." " ")))))
;; -------------------------------------------------------------------------- ;; ;; -------------------------------------------------------------------------- ;;
;; ;;