<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs.git/tests/test-org-sort-by-todo-and-priority.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>2026-01-24T19:28:12+00:00</updated>
<entry>
<title>fix(tests): fix failing tests across multiple modules</title>
<updated>2026-01-24T19:28:12+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-01-24T19:28:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs.git/commit/?id=92e2b82170f77ef2b21686916485fb2e3f61efb6'/>
<id>urn:sha1:92e2b82170f77ef2b21686916485fb2e3f61efb6</id>
<content type='text'>
- test-org-noter: add org-id require for org-id-uuid
- test-org-agenda: update to expect 4 base files (pcal added)
- test-org-refile: fix lambda signatures for directory-files-recursively
- test-org-sort: stub cj/custom-keymap, cj/org-map, org-dir
- test-calendar-sync: mark Saturday weekday test as expected-fail (timezone issue)
</content>
</entry>
<entry>
<title>Revert "checking in modified/removed tests and other misc changes"</title>
<updated>2025-11-14T08:35:00+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-14T08:35:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs.git/commit/?id=0febc3bb65462fd95a75387c2ec97ffa374efc00'/>
<id>urn:sha1:0febc3bb65462fd95a75387c2ec97ffa374efc00</id>
<content type='text'>
This reverts commit 9d55ed149e100b4fb3ef6f5a79d263dcb26ce835.
</content>
</entry>
<entry>
<title>checking in modified/removed tests and other misc changes</title>
<updated>2025-11-14T08:31:16+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-14T08:31:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs.git/commit/?id=9d55ed149e100b4fb3ef6f5a79d263dcb26ce835'/>
<id>urn:sha1:9d55ed149e100b4fb3ef6f5a79d263dcb26ce835</id>
<content type='text'>
</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>
</feed>
