<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs.git/modules/ui-config.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-14T08:25:19+00:00</updated>
<entry>
<title>fix(ui): Fix cursor color updates with post-command-hook</title>
<updated>2025-11-14T08:25:19+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-14T08:25:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs.git/commit/?id=7b982b1984dd37af42a2dfc9f4c3e52b27102860'/>
<id>urn:sha1:7b982b1984dd37af42a2dfc9f4c3e52b27102860</id>
<content type='text'>
The cursor color was not updating correctly when switching buffers
or modifying files. The original implementation used window-buffer-change
and other specific hooks, but these were insufficient and internal
buffers were interfering with cursor color updates.

Root cause:
- Cursor color is global (one cursor for all of Emacs)
- Previous hooks fired in internal buffer contexts (*Echo Area*, *temp*)
- This caused cursor to be set to white (unmodified) even when in
  read-only buffers like dashboard

Solution:
- Use post-command-hook which runs after every command in current buffer
- Ignore internal buffers (names starting with space)
- Cache optimization prevents redundant set-cursor-color calls

Behavior now:
- Dashboard (read-only): Red cursor
- Unmodified file: White cursor
- Modified file: Green cursor
- After save: White cursor

Tests:
- Added 9 integration tests in test-ui-cursor-color-integration.el
- Tests verify hook installation, buffer switching, modification tracking
- All 27 tests passing (18 unit + 9 integration)

Integration tests catch issues that unit tests miss:
- Unit tests verified state detection logic (✓)
- Integration tests verify hooks fire at right times (✓ now)
- Integration tests verify real buffer switching behavior (✓ now)

Cleanup:
- Removed debug code from init.el
- Removed debug-cursor-color.el temporary file

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

Co-Authored-By: Claude &lt;noreply@anthropic.com&gt;
</content>
</entry>
<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>
<entry>
<title>feat: Fix modeline lag and add org multi-level sort with comprehensive tests</title>
<updated>2025-11-08T22:11:58+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-08T22:11:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs.git/commit/?id=8176eff73b826f7fec9d7f458f7d2f36f4d12e58'/>
<id>urn:sha1:8176eff73b826f7fec9d7f458f7d2f36f4d12e58</id>
<content type='text'>
Performance improvement and new feature with full test coverage.

## Changes

### 1. Fix modeline line/column position lag (#A priority)
- Replace expensive line-number-at-pos with cached %l/%c format specifiers
- Enable line-number-mode explicitly for caching
- Result: Instant modeline updates, zero performance overhead
- Files: modules/modeline-config.el:81-83, modules/ui-config.el:53

### 2. Implement multi-level org sorting
- New function: cj/org-sort-by-todo-and-priority
- Sorts by TODO status (TODO before DONE) AND priority (A→B→C→D)
- Uses stable sorting: priority first, then TODO state
- Gracefully handles empty sections (no error)
- Bound to C-; o o (ordering → org sort)
- Files: modules/org-config.el:278-299, modules/custom-ordering.el:253,267

### 3. Comprehensive ERT test suite (12/12 passing)
- Normal cases: Mixed TODO/DONE, multiple of same type, same priority
- Boundary cases: Empty sections, single entries, no priorities
- Error cases: Non-org-mode buffer
- Test file: tests/test-org-sort-by-todo-and-priority.el

### 4. Testing improvements discovered
- Disable org-mode hooks to avoid package dependencies in batch mode
- org-sort-entries must be called from parent heading
- Preserve priority cookie in org-get-heading (t t nil t)
- Add condition-case to handle "Nothing to sort" gracefully

### 5. Minor cleanup
- Comment out chime-debug setting (org-agenda-config.el:267)
- Mark modeline lag task as DONE in todo.org

## Technical Details

Modeline optimization:
- line-number-at-pos is O(n) where n = current line
- %l and %c are O(1) lookups from cached values

Org sorting algorithm uses stable sort:
1. Sort by priority (A, B, C, D, unprioritized)
2. Sort by TODO status (preserves priority order within groups)
Result: TODO [#A], TODO [#B], DONE [#A], DONE [#B], etc.

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

Co-Authored-By: Claude &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>feat: Complete modeline overhaul with custom segments and interactive features</title>
<updated>2025-11-04T00:01:24+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-04T00:01:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs.git/commit/?id=c0c4b176ace7910cbc1a71b5ec473873b6d821be'/>
<id>urn:sha1:c0c4b176ace7910cbc1a71b5ec473873b6d821be</id>
<content type='text'>
Replaced mood-line with a custom, minimal modeline using only built-in
Emacs functionality to avoid native compilation issues.

**Architecture:**
- Named segment system using defvar-local for easy reordering
- Emacs 30 built-in right-alignment (mode-line-format-right-align)
- All segments marked as risky-local-variable for proper evaluation

**Features:**
- Color-coded buffer names (green=writeable, red=read-only, gold=overwrite)
- VC branch with git symbol (U+E0A0) and state-based coloring
- Position format: L:line C:col
- Help-echo tooltips on all segments
- Mouse click handlers for interactive actions
- String truncation in narrow windows (&lt; 100 chars)
- Active-window-only display for branch and misc-info

**Interactive Actions:**
- Buffer name: mouse-1 = prev-buffer, mouse-3 = next-buffer
- Major mode: mouse-1 = describe-mode
- Git branch: mouse-1 = vc-diff, mouse-3 = vc-root-diff

**Bug Fixes:**
- Disabled async native compilation to prevent "Selecting deleted buffer" errors
- Fixed difftastic loading by changing :demand to :defer
- Abstracted buffer status colors to user-constants.el for reuse

Inspired by Prot's modeline design patterns.

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

Co-Authored-By: Claude &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>refactor: ui-config: replace defcustom with defvar for consistency</title>
<updated>2025-10-20T16:48:51+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-10-20T16:48:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs.git/commit/?id=bd45daa2e79fe148465304f0d469842e2047403d'/>
<id>urn:sha1:bd45daa2e79fe148465304f0d469842e2047403d</id>
<content type='text'>
- Change `defcustom` to `defvar` for transparency variables.
- Improve error handling in `cj/set-frame-alpha`.
- Optimize cursor color update with efficient hooks.
- Defer `nerd-icons` loading for better startup performance.
</content>
</entry>
<entry>
<title>changing repositories</title>
<updated>2025-10-12T16:47:26+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-10-12T16:47:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs.git/commit/?id=092304d9e0ccc37cc0ddaa9b136457e56a1cac20'/>
<id>urn:sha1:092304d9e0ccc37cc0ddaa9b136457e56a1cac20</id>
<content type='text'>
</content>
</entry>
</feed>
