<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dotemacs/modules/auth-config.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-24T21:26:06+00:00</updated>
<entry>
<title>docs(load-graph): classify core libraries and command modules</title>
<updated>2026-05-24T21:26:06+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-24T21:26:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=67d8040ad19461cf2a393af95268f92b784d7ece'/>
<id>urn:sha1:67d8040ad19461cf2a393af95268f92b784d7ece</id>
<content type='text'>
Third classification batch: the remaining core and library command modules from init.el's early block — external-open, media-utils, auth-config, keyboard-macros, system-utils, text-config, undead-buffers. I annotated each with the load-graph header contract, added a Batch 3 table to the inventory, and extended the validation allowlist. 23 of 102 modules are now classified.

No new hidden dependencies in this batch. auth-config stays eager because other modules need credentials early; the command libraries (external-open, media-utils, keyboard-macros) are eager only by init order and flagged as Phase 4 deferral candidates.
</content>
</entry>
<entry>
<title>fix: clarify reset-auth-cache failure message</title>
<updated>2026-05-04T00:40:28+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-04T00:40:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=d341beea020cfad52942b854a8f42d0be2e34ae9'/>
<id>urn:sha1:d341beea020cfad52942b854a8f42d0be2e34ae9</id>
<content type='text'>
`cj/reset-auth-cache`'s error path read "Failed to clear gpg-agent cache". A user seeing that warning could reasonably think nothing happened. But at that point the Emacs-side caches (auth-source + EPA file handler) have already been cleared. Only the gpg-agent cache failed.

I rewrote the message as "Emacs caches cleared, but failed to clear gpg-agent cache" so the user sees both the partial success and the remaining problem.

The error-path test from the previous commit asserts a substring match on "Failed to clear gpg-agent cache", so it still passes after the rewording.
</content>
</entry>
<entry>
<title>fix: default auth-source debug logging to disabled</title>
<updated>2026-05-04T00:40:17+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-05-04T00:40:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=e646995e940281e0ef575abc71532ac17f1b4fa9'/>
<id>urn:sha1:e646995e940281e0ef575abc71532ac17f1b4fa9</id>
<content type='text'>
`auth-config.el` was setting `auth-source-debug` to t at startup. That meant every credential lookup printed verbose context to *Messages*. The flag was useful while debugging GPG flow but not appropriate for steady state, since the same config handles Slack, AI, REST, mail, and transcription credentials.

I added a `cj/auth-source-debug-enabled` defcustom (default nil) and wired the use-package block to read its value. For temporary troubleshooting I added two commands: `cj/set-auth-source-debug` (prompted on / off via `y-or-n-p`) and `cj/toggle-auth-source-debug` (M-x convenience).

I also scanned the nearby auth callers. The visible failure messages name hosts and logins but don't print secret values directly. So this change closes the practical exposure path without losing useful diagnostics.

I added `tests/test-auth-config-debug.el` covering the disabled-by-default invariant and the setter wiring through both public variables.
</content>
</entry>
<entry>
<title>fix(keybindings): remove auth-cache binding from C-; A</title>
<updated>2026-02-15T20:41:12+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2026-02-15T20:41:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=453b4765b9626ea20cb8507f6fa3583fa02451f6'/>
<id>urn:sha1:453b4765b9626ea20cb8507f6fa3583fa02451f6</id>
<content type='text'>
Resolves conflict with align-regexp on the same key. Auth cache reset
is accessible via M-x cj/reset-auth-cache.
</content>
</entry>
<entry>
<title>refactor: Use cj/log-silently for debug messages</title>
<updated>2025-11-17T04:10:58+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-17T04:10:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=6f57d93f9fa09ccbd97a767ba995a5755dedc103'/>
<id>urn:sha1:6f57d93f9fa09ccbd97a767ba995a5755dedc103</id>
<content type='text'>
Converted debug/informational messages to use cj/log-silently instead of
message across multiple modules. These are automatic initialization or
background task messages that don't need minibuffer display but should
still be logged to *Messages* buffer.

Changes:
- org-agenda-config.el: Cache build/hit messages (4 messages)
- org-refile-config.el: Cache build/hit + mode switching (5 messages)
- org-export-config.el: reveal.js download message (1 message)
- auth-config.el: oauth2-auto cache fix message (1 message)
- quick-video-capture.el: initialization message (1 message)

All modules now require system-lib for cj/log-silently function.
Keeps UI clean while maintaining debuggability.
</content>
</entry>
<entry>
<title>fix: Resolve Google Calendar password prompts via advice</title>
<updated>2025-11-11T23:39:43+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-11T23:35:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=90dcf621cffdd752db02444511cb4b94adc72b50'/>
<id>urn:sha1:90dcf621cffdd752db02444511cb4b94adc72b50</id>
<content type='text'>
Fixed oauth2-auto.el caching bug using Emacs advice system (survives updates).

Root Cause:
- oauth2-auto version 20250624.1919 has `or nil` on line 206
- This completely disables the internal hash-table cache
- Every org-gcal sync requires decrypting oauth2-auto.plist from disk
- GPG passphrase prompted every ~15 minutes (violated "Frictionless" value)

The Fix (via advice):
- Created cj/oauth2-auto--plstore-read-fixed with cache enabled
- Applied as :override advice to oauth2-auto--plstore-read
- Survives package updates (unlike direct modification)
- Can be easily removed if upstream fixes the bug

Changes:
- modules/auth-config.el:
  * Added cj/oauth2-auto--plstore-read-fixed (lines 75-93)
  * Applied advice on package load (lines 96-98)
  * Added cj/clear-oauth2-auto-cache helper
  * Documented fix in commentary (lines 16-22)
- todo.org: Mark #A priority task as DONE
- docs/oauth2-auto-cache-fix.md: Detailed documentation

Result:
- Passphrase prompted ONCE per Emacs session (on cold start)
- Subsequent org-gcal syncs use cached tokens (no prompts)
- Workflow now frictionless as intended
- Fix persists across package updates

Upstream:
- Bug acknowledged in code: "Assume cache is invalidated. FIXME"
- Should report to: https://github.com/rhaps0dy/emacs-oauth2-auto
- Simple fix: Remove `or nil` on line 206
</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/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>feat: Add comprehensive authentication cache reset utility</title>
<updated>2025-11-06T23:58:40+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-11-06T23:58:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=37ad0ecd93d6e24161fd55ef930a144869efb427'/>
<id>urn:sha1:37ad0ecd93d6e24161fd55ef930a144869efb427</id>
<content type='text'>
Added cj/reset-auth-cache function to recover from incorrect password
entry for encrypted files like authinfo.gpg. Resolves "Bad session key"
and "Decryption failed" errors.

Key features:
- Smart cache clearing: preserves 400-day GPG/SSH cache by default
- Optional prefix arg (C-u) to also clear gpg-agent cache
- Clears auth-source, EPA file handler, and optionally gpg-agent caches
- Bound to C-; A for easy access (removed from debug menu C-c d)

Also added cj/kill-gpg-agent for aggressive agent reset when needed.

Consolidates and replaces simpler auth-source-only version that was
previously in config-utilities.el.
</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>fix cosmetic whitespace issue</title>
<updated>2025-10-22T17:14:59+00:00</updated>
<author>
<name>Craig Jennings</name>
<email>c@cjennings.net</email>
</author>
<published>2025-10-22T17:14:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.cjennings.net/dotemacs/commit/?id=2a543ea6a0fd018a24008fba514a6967c3f62cfb'/>
<id>urn:sha1:2a543ea6a0fd018a24008fba514a6967c3f62cfb</id>
<content type='text'>
</content>
</entry>
</feed>
