summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/abbrev_defs11
-rw-r--r--modules/auth-config.el61
-rw-r--r--modules/config-utilities.el12
-rw-r--r--todo.org49
4 files changed, 116 insertions, 17 deletions
diff --git a/assets/abbrev_defs b/assets/abbrev_defs
index 3060620f..cd9c6818 100644
--- a/assets/abbrev_defs
+++ b/assets/abbrev_defs
@@ -33,7 +33,7 @@
("aethetically" "aesthetically" nil :count 0)
("agression" "aggression" nil :count 0)
("agressive" "aggressive" nil :count 0)
- ("ahve" "have" nil :count 14)
+ ("ahve" "have" nil :count 15)
("aknowledge" "acknowledge" nil :count 0)
("alegiance" "allegiance" nil :count 0)
("allegaince" "allegiance" nil :count 0)
@@ -215,7 +215,7 @@
("hrie" "hire" nil :count 0)
("htey" "they" nil :count 3)
("humerous" "humorous" nil :count 0)
- ("hygeine" "hygiene" nil :count 0)
+ ("hygeine" "hygiene" nil :count 1)
("hygene" "hygiene" nil :count 0)
("hygine" "hygiene" nil :count 0)
("idnetify" "identify" nil :count 0)
@@ -294,7 +294,7 @@
("oppositiion" "opposition" nil :count 0)
("opppsite" "opposite" nil :count 0)
("orignal" "original" nil :count 0)
- ("ot" "to" nil :count 41)
+ ("ot" "to" nil :count 42)
("otehr" "other" nil :count 3)
("otes" "notes" nil :count 0)
("outgoign" "outgoing" nil :count 0)
@@ -393,7 +393,7 @@
("takss" "tasks" nil :count 3)
("talekd" "talked" nil :count 0)
("talkign" "talking" nil :count 6)
- ("teh" "the" nil :count 155)
+ ("teh" "the" nil :count 156)
("tehir" "their" nil :count 5)
("tehre" "there" nil :count 3)
("testimentary" "testamentary" nil :count 1)
@@ -428,10 +428,11 @@
("warant" "warrant" nil :count 0)
("welfair" "welfare" nil :count 0)
("welomce" "welcome" nil :count 0)
+ ("whcih" "which" nil :count 0)
("whenter" "whether" nil :count 0)
("whenver" "whenever" nil :count 0)
("wierd" "weird" nil :count 0)
- ("wihtout" "without" nil :count 0)
+ ("wihtout" "without" nil :count 1)
("windsheild" "windshield" nil :count 0)
("withdrawls" "withdrawals" nil :count 0)
("withold" "withhold" nil :count 0)
diff --git a/modules/auth-config.el b/modules/auth-config.el
index 8376a2c0..2b52087e 100644
--- a/modules/auth-config.el
+++ b/modules/auth-config.el
@@ -55,5 +55,66 @@
;; Allow gpg-agent to cache the passphrase (400 days per gpg-agent.conf)
(setq plstore-encrypt-to nil)) ;; Use symmetric encryption, not key-based
+;; ------------------------ Authentication Reset Utility -----------------------
+
+(defun cj/reset-auth-cache (&optional include-gpg-agent)
+ "Reset authentication caches when wrong password was entered.
+
+By default, only clears Emacs-side caches (auth-source, EPA file
+handler) and leaves gpg-agent's long-term cache intact. This preserves
+your 400-day cache for GPG and SSH passphrases.
+
+With prefix argument INCLUDE-GPG-AGENT (\\[universal-argument]), also
+clears gpg-agent's password cache. Use this when gpg-agent itself has
+cached an incorrect password.
+
+Clears:
+1. auth-source cache (Emacs-level credential cache)
+2. EPA file handler cache (encrypted file cache)
+3. gpg-agent cache (only if INCLUDE-GPG-AGENT is non-nil)
+
+Use this when you see errors like:
+ - \"Bad session key\"
+ - \"Decryption failed\"
+ - GPG repeatedly using wrong cached password"
+ (interactive "P")
+ (message "Resetting authentication caches...")
+
+ ;; Clear auth-source cache (Emacs credential cache)
+ (auth-source-forget-all-cached)
+
+ ;; Clear EPA file handler cache
+ (when (fboundp 'epa-file-clear-cache)
+ (epa-file-clear-cache))
+
+ ;; Only clear gpg-agent cache if explicitly requested
+ (if include-gpg-agent
+ (let ((result (shell-command "echo RELOADAGENT | gpg-connect-agent")))
+ (if (zerop result)
+ (message "✓ Emacs and gpg-agent caches cleared. Next access will prompt for password.")
+ (message "⚠ Warning: Failed to clear gpg-agent cache")))
+ (message "✓ Emacs caches cleared. GPG/SSH passphrases preserved for session.")))
+
+(defun cj/kill-gpg-agent ()
+ "Force kill gpg-agent (it will restart automatically on next use).
+
+This is a more aggressive reset than `cj/reset-auth-cache'. Use this
+when gpg-agent is stuck or behaving incorrectly.
+
+The gpg-agent will automatically restart on the next GPG operation."
+ (interactive)
+ (let ((result (shell-command "gpgconf --kill gpg-agent")))
+ (if (zerop result)
+ (message "✓ gpg-agent killed. It will restart automatically on next use.")
+ (message "⚠ Warning: Failed to kill gpg-agent"))))
+
+;; Keybindings
+(with-eval-after-load 'keybindings
+ (keymap-set cj/custom-keymap "A" #'cj/reset-auth-cache))
+
+(with-eval-after-load 'which-key
+ (which-key-add-key-based-replacements
+ "C-; A" "reset auth cache"))
+
(provide 'auth-config)
;;; auth-config.el ends here.
diff --git a/modules/config-utilities.el b/modules/config-utilities.el
index 32018371..2af3effa 100644
--- a/modules/config-utilities.el
+++ b/modules/config-utilities.el
@@ -33,8 +33,7 @@
"C-c d i b" "info build"
"C-c d i p" "info packages"
"C-c d i f" "info features"
- "C-c d r" "reload init"
- "C-c d a" "reset auth cache"))
+ "C-c d r" "reload init"))
;;; --------------------------------- Profiling ---------------------------------
@@ -283,15 +282,6 @@ Recompile natively when supported, otherwise fall back to byte compilation."
(load-file user-init-file))
(keymap-set cj/debug-config-keymap "r" 'cj/reload-init-file)
-;; ----------------------------- Reset-Auth-Sources ----------------------------
-
-(defun cj/reset-auth-cache ()
- "Clear Emacs auth-source cache."
- (interactive)
- (auth-source-forget-all-cached)
- (message "Emacs auth-source cache cleared."))
-(keymap-set cj/debug-config-keymap "a" 'cj/reset-auth-cache)
-
;; ------------------------ Validate Org Agenda Entries ------------------------
(defun cj/validate-org-agenda-timestamps ()
diff --git a/todo.org b/todo.org
index dfaadec7..8c7d51b7 100644
--- a/todo.org
+++ b/todo.org
@@ -17,7 +17,7 @@ If the answer is "no" to all five → DON'T ADD IT.
V2MOM is located at: [[file:docs/emacs-config-v2mom.org][emacs-config-v2mom.org]]
Research/ideas that don't serve vision: [[file:docs/someday-maybe.org][someday-maybe.org]]
-* Method 1: Make Using Emacs Frictionless [8/13]
+* Method 1: Make Using Emacs Frictionless [8/14]
** DONE [#A] Remove network check from startup (saves 1+ seconds)
CLOSED: [2025-10-31 Fri]
@@ -194,6 +194,52 @@ Generate transcript (once transcription workflow exists).
Daily workflow improvement.
+** TODO [#A] Fix Google Calendar password prompts every 15 minutes
+
+IRRITANT: gcal-sync triggers password prompts approximately every 15 minutes,
+interrupting workflow and breaking focus. This defeats the purpose of having
+passphrase caching configured.
+
+**Current Setup:**
+- GPG agent configured with 400-day cache (gpg-agent.conf):
+ - default-cache-ttl 34560000
+ - max-cache-ttl 34560000
+ - allow-loopback-pinentry enabled
+- Plstore caching enabled (auth-config.el:54):
+ - plstore-cache-passphrase-for-symmetric-encryption t
+ - plstore-encrypt-to nil (symmetric encryption)
+- Auth-source cache: 24 hours (auth-config.el:31)
+- Auto-sync interval: 30 minutes (org-gcal-config.el:50)
+
+**Problem:**
+Despite proper GPG agent caching, oauth2-auto.plist prompts for passphrase
+every ~15 minutes during gcal-sync operations. This suggests:
+1. plstore may not be using GPG agent cache properly for symmetric encryption
+2. oauth2-auto token refresh might be bypassing cache
+3. EPinentry mode may need explicit configuration (currently commented out)
+
+**Goal:**
+Passphrase should be entered ONCE per Emacs session, then cached until Emacs
+closes. No interruptions during normal work.
+
+**Investigation Paths:**
+1. Check if oauth2-auto respects plstore passphrase caching
+2. Investigate plstore symmetric encryption cache behavior with GPG agent
+3. Test enabling epa-pinentry-mode 'loopback (auth-config.el:42)
+4. Check oauth2-auto token refresh cycle vs password prompt timing
+5. Consider oauth2-auto configuration options for token persistence
+6. Review org-gcal or oauth2-auto issues for similar problems
+
+**Files:**
+- modules/auth-config.el (plstore and GPG configuration)
+- modules/org-gcal-config.el (org-gcal and oauth2-auto setup)
+- ~/.gnupg/gpg-agent.conf (GPG agent cache settings)
+- oauth2-auto.plist (encrypted OAuth tokens - prompts every access?)
+
+**Related:**
+This violates the "Frictionless" value - interruptions every 15 minutes during
+calendar sync breaks concentration and workflow momentum.
+
** TODO [#B] Optimize org-agenda performance using built-in profiler
THE BOTTLENECK. Currently 30+ seconds, target < 5 seconds.
@@ -404,3 +450,4 @@ Review this inbox, cancel stale items, keep < 20 active. Track in calendar.
Can't research next thing until current thing is implemented.
* Emacs Config Inbox
+** TODO cj/flyspell-then-abbrev loses keybinding in scratch org-mode buffer