<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs.git/tests/test-ui-buffer-status-colors.el, branch v0.7.2</title>
<subtitle>my Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs.git/atom?h=v0.7.2</id>
<link rel='self' href='https://git.cjennings.net/dotemacs.git/atom?h=v0.7.2'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs.git/'/>
<updated>2025-11-14T07:53:30+00:00</updated>
<entry>
<title>feat(ui): Add buffer modification state to color indicators</title>
<updated>2025-11-14T07:53:30+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-14T07:53:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs.git/commit/?id=fd1a5d308e730bad2936adb2384897bb620458be'/>
<id>urn:sha1:fd1a5d308e730bad2936adb2384897bb620458be</id>
<content type='text'>
Change modeline filename and cursor colors to indicate buffer
modification status, not just read-only/overwrite state.

Color scheme changes:
- White (#ffffff): Unmodified writeable buffer
- Green (#64aa0f): Modified writeable buffer (unsaved changes)
- Red (#f06a3f): Read-only buffer
- Gold (#c48702): Overwrite mode active

Previously: All writeable buffers were green regardless of modification
Now: White when clean, green when dirty (better visual feedback)

Implementation:
- Updated cj/buffer-status-colors in user-constants.el:
  - Changed 'normal' → 'unmodified' (white)
  - Added new 'modified' state (green)
- Updated state detection in modeline-config.el:
  - Now checks (buffer-modified-p) before defaulting to unmodified
- Updated cursor color logic in ui-config.el:
  - Same state detection as modeline for consistency
  - Added after-change-functions hook for real-time updates
  - Added after-save-hook to update on save

Priority order (highest to lowest):
1. Read-only (red) - takes precedence over everything
2. Overwrite mode (gold) - takes precedence over modified state
3. Modified (green) - buffer has unsaved changes
4. Unmodified (white) - default for clean writeable buffers

Tests:
- 18 comprehensive tests in test-ui-buffer-status-colors.el
- Tests state detection logic and priority order
- Tests color constant definitions and mappings
- Tests integration with cursor and modeline
- All tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude &lt;noreply@anthropic.com&gt;
</content>
</entry>
</feed>
