<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/modules/org-gcal-config.el, branch performance</title>
<subtitle>My Emacs configuration
</subtitle>
<id>https://git.cjennings.net/dotemacs/atom?h=performance</id>
<link rel='self' href='https://git.cjennings.net/dotemacs/atom?h=performance'/>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/'/>
<updated>2025-11-08T22:11:58+00:00</updated>
<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/commit/?id=513dfd2a1d497da8bd9d5261458cf4140dce7ad6'/>
<id>urn:sha1:513dfd2a1d497da8bd9d5261458cf4140dce7ad6</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.
</content>
</entry>
<entry>
<title>fix: Resolve Google Calendar password prompts every 10 minutes</title>
<updated>2025-11-05T06:53:52+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-05T06:53:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=df1795543a272e2f637f9b3016f33786a9c1148e'/>
<id>urn:sha1:df1795543a272e2f637f9b3016f33786a9c1148e</id>
<content type='text'>
Problem: oauth2-auto.plist passphrase requested every ~10 minutes during
gcal-sync auto-sync, interrupting workflow despite 400-day gpg-agent cache.

Root cause: auth-config.el was setting GPG_AGENT_INFO to nil, telling
Emacs to ignore gpg-agent entirely. Additionally, plstore caching was
loading too late in org-gcal-config.

Solution:
- Disabled GPG_AGENT_INFO override to allow gpg-agent usage
- Added auth-source-cache-expiry (24-hour cache for credentials)
- Moved plstore configuration from org-gcal-config to auth-config
- Enabled plstore-cache-passphrase-for-symmetric-encryption globally
- Set plstore-encrypt-to nil for symmetric encryption

Files modified:
- modules/auth-config.el: Added plstore config, removed agent bypass
- modules/org-gcal-config.el: Removed duplicate plstore config
- docs/NOTES.org: Session notes documenting fix

Testing: Restart Emacs and verify no password prompts for 30+ minutes.
</content>
</entry>
<entry>
<title>feat: Add complete async audio transcription workflow</title>
<updated>2025-11-04T20:35:50+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-04T20:35:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=d9bcfaa1d4924897a313499c4ce6821e32e53d5b'/>
<id>urn:sha1:d9bcfaa1d4924897a313499c4ce6821e32e53d5b</id>
<content type='text'>
Implemented full transcription system with local Whisper and OpenAI API
support. Includes comprehensive test suite (60 tests) and reorganized
keybindings for better discoverability.

Features:
- Async transcription (non-blocking workflow)
- Desktop notifications (started/complete/error)
- Output: audio.txt (transcript) + audio.log (process logs)
- Modeline integration showing active transcription count
- Dired integration (press T on audio files)
- Process management and tracking

Scripts:
- install-whisper.sh: Install Whisper via AUR or pip
- uninstall-whisper.sh: Clean removal with cache cleanup
- local-whisper: Offline transcription using installed Whisper
- oai-transcribe: Cloud transcription via OpenAI API

Tests (60 passing):
- Audio file detection (16 tests)
- Path generation logic (11 tests)
- Log cleanup behavior (5 tests)
- Duration formatting (9 tests)
- Active counter &amp; modeline (11 tests)
- Integration workflows (8 tests)

Keybindings:
- Reorganized gcal to C-; g submenu (s/t/r/c)
- Added C-; t transcription submenu (t/b/k)
- Dired: T to transcribe file at point
</content>
</entry>
<entry>
<title>fix: Change org-gcal to use Google Calendar as authoritative source</title>
<updated>2025-11-02T03:45:34+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-02T03:45:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=66e8845cd93562074d03ab4826d59524a3f34cb5'/>
<id>urn:sha1:66e8845cd93562074d03ab4826d59524a3f34cb5</id>
<content type='text'>
Changed from bidirectional "org" mode to "gcal" mode to avoid sync conflicts.
This prevents HTTP 412 errors on recurring events and HTTP 400 errors on
modified events.

Google Calendar is now authoritative:
- org-gcal-managed-newly-fetched-mode: "gcal" (was "org")
- org-gcal-managed-update-existing-mode: "gcal" (was "org")

Benefits:
- No more version conflicts on recurring events
- Cleaner sync without errors
- Google Calendar changes always win
</content>
</entry>
<entry>
<title>feat: Add org-gcal dependencies and org-contacts birthday automation</title>
<updated>2025-11-02T03:37:38+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-02T03:37:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=7e5c4cda4fc8f7954d26f8c633b8a2d41740eff1'/>
<id>urn:sha1:7e5c4cda4fc8f7954d26f8c633b8a2d41740eff1</id>
<content type='text'>
org-gcal-config.el:
- Add use-package declarations for deferred and oauth2-auto
- Ensures dependencies are automatically installed on fresh systems
- Fixes "Cannot open load file" errors when syncing

org-contacts-config.el:
- Add automatic birthday timestamp insertion via capture template
- Parse YYYY-MM-DD or MM-DD birthday formats
- Insert yearly repeating timestamps after properties drawer
- Add NICKNAME and NOTE fields to capture template

org-agenda-config.el:
- Enable chime-debug mode for troubleshooting
</content>
</entry>
<entry>
<title>feat:org-gcal: Auto-save files after sync completion</title>
<updated>2025-10-29T14:00:57+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-10-29T14:00:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=e5371ef4cc7a4f5377193474f328ed79047ab16c'/>
<id>urn:sha1:e5371ef4cc7a4f5377193474f328ed79047ab16c</id>
<content type='text'>
Add a function to automatically save all org-gcal files after
synchronization completes. This ensures that any changes are
persisted, enhancing data consistency. Advise
`org-gcal--sync-unlock` to trigger auto-saving upon sync completion.
</content>
</entry>
<entry>
<title>maint:vc install org-msg, disable debugging on org-gcal</title>
<updated>2025-10-28T02:24:51+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-10-28T02:24:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=076d8c26e463fef339997a3e19df42d1879f5a81'/>
<id>urn:sha1:076d8c26e463fef339997a3e19df42d1879f5a81</id>
<content type='text'>
</content>
</entry>
<entry>
<title>maint:org-gcal: Add forward declarations and update org-gcal usage</title>
<updated>2025-10-28T01:39:09+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-10-28T01:39:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=8953d671b5ce15c96cb9b992a9783148f7867bcc'/>
<id>urn:sha1:8953d671b5ce15c96cb9b992a9783148f7867bcc</id>
<content type='text'>
Forward declare internal org-gcal variables and functions to improve
code clarity. Update use-package declaration with version control
information to use my fork of org-gcal (fixes, better testing).
</content>
</entry>
<entry>
<title>feat:which-key: Add descriptive labels for custom keymaps</title>
<updated>2025-10-27T23:45:23+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-10-27T23:45:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=87034eab17625165b884128d8058c1158fc2f50f'/>
<id>urn:sha1:87034eab17625165b884128d8058c1158fc2f50f</id>
<content type='text'>
Enhance which-key integration by providing detailed descriptions for
new key bindings across multiple modules. This improves the
usability of custom keymaps by clarifying the purpose of each
keybinding, making it easier for users to navigate and understand
different menus and options available within the configuration.

This update ensures that all custom keymaps now display a
descriptive label in the which-key popup to explain their
functionality, aiding users in identifying keymap purposes promptly.
</content>
</entry>
<entry>
<title>feat:org-gcal: Add function to clear sync lock and binding</title>
<updated>2025-10-25T21:37:56+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-10-25T21:37:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=757a7778a2053e14fbbccf1accab7b76edd54383'/>
<id>urn:sha1:757a7778a2053e14fbbccf1accab7b76edd54383</id>
<content type='text'>
Add `cj/org-gcal-clear-sync-lock` function to allow clearing the
`org-gcal` sync lock. This is useful when a sync fails and leaves
the lock in place, preventing future syncs. This function can be
invoked with the keybinding "C-; G". Additionally, ensure
credentials are retrieved from `authinfo.gpg` before loading
`org-gcal`.
</content>
</entry>
</feed>
