<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/tests/test-modeline-config-flycheck-segment.el, branch main</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=main</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2026-05-16T07:12:56+00:00</updated>
<entry>
<title>feat(modeline): surface flycheck status in the custom modeline</title>
<updated>2026-05-16T07:12:56+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-16T07:12:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=adca2736e2e3ef1eef1aaf62542aa2189a560463'/>
<id>urn:sha1:adca2736e2e3ef1eef1aaf62542aa2189a560463</id>
<content type='text'>
The custom modeline builds `mode-line-format` from explicit segments
and skips `minor-mode-alist`, so flycheck's lighter never appears.
That hid error and warning counts even in buffers where flycheck was
auto-enabling (every emacs-lisp and sh buffer).

The fix is Option 4 from the design doc: customize the flycheck
modeline variables, then add a single guarded `(:eval ...)` form to
`mode-line-format`.  Five new lines total, two-file change.

`modules/flycheck-config.el` :custom block gets:
  (flycheck-mode-line-prefix "🐛")
  (flycheck-mode-success-indicator " ✓")
`flycheck-mode-line-color` stays default-t so error / warning counts
pick up their faces automatically.

`modules/modeline-config.el` `mode-line-format` gets an `(:eval ...)`
between the recording indicator and `cj/modeline-vc-branch`:

  (:eval (when (and (mode-line-window-selected-p)
                    (bound-and-true-p flycheck-mode))
           (flycheck-mode-line-status-text)))

The `mode-line-window-selected-p` guard mirrors `cj/modeline-vc-branch`
and `cj/modeline-misc-info` -- segments hide in inactive windows.
The `bound-and-true-p flycheck-mode` guard keeps the form silent in
buffers where flycheck hasn't loaded or isn't enabled, which is
safer than referencing `flycheck-mode` directly.

The `(:eval ...)` is inline rather than a named `defvar-local`, so no
addition to the risky-local-variable list is needed.

`tests/test-modeline-config-flycheck-segment.el` -- 3 smoke tests
asserting the segment is present and both guards are in place.  All
existing tests stay green.

Manual verification (per the design doc) is the user's call -- the
emoji prefix and the colored count behavior need a running GUI Emacs
to observe.
</content>
</entry>
</feed>
