aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-15 21:38:00 -0500
committerCraig Jennings <c@cjennings.net>2026-06-15 21:38:00 -0500
commitcd95ea79d004ca874dcc17dc2334f25efdb1bf9a (patch)
treed4515a6e7ebac96e2a2d6b50e5193a7d7ae1d237 /modules
parent902290a4c15d905418e1ad354e7ee06cfa35b3f1 (diff)
downloaddotemacs-cd95ea79d004ca874dcc17dc2334f25efdb1bf9a.tar.gz
dotemacs-cd95ea79d004ca874dcc17dc2334f25efdb1bf9a.zip
fix(auth-config): guard gpg-connect-agent, require user-constants at runtime
- The bare call-process to gpg-connect-agent in :config aborted init with file-missing on a machine without the binary. Guard it with cj/executable-find-or-warn. - user-constants was required only eval-when-compile, but authinfo-file is read at load time, so a standalone .elc load failed. Require it at runtime.
Diffstat (limited to 'modules')
-rw-r--r--modules/auth-config.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/auth-config.el b/modules/auth-config.el
index 7f729f02a..f18c0c1fd 100644
--- a/modules/auth-config.el
+++ b/modules/auth-config.el
@@ -33,7 +33,7 @@
;;; Code:
(require 'system-lib)
-(eval-when-compile (require 'user-constants)) ;; defines authinfo-file location
+(require 'user-constants) ;; defines authinfo-file, read at load time below
(defcustom cj/auth-source-debug-enabled nil
"Non-nil means enable verbose auth-source debug logging.
@@ -83,9 +83,11 @@ much context about sensitive services in the Messages buffer."
;; (setq epa-pinentry-mode 'loopback) ;; emacs request passwords in minibuffer
(setq epg-gpg-program "gpg2") ;; force use gpg2 (not gpg v.1)
- ;; Update gpg-agent with current DISPLAY environment
- ;; This ensures pinentry can open GUI windows when Emacs starts
- (call-process "gpg-connect-agent" nil nil nil "updatestartuptty" "/bye"))
+ ;; Update gpg-agent with the current DISPLAY so pinentry can open GUI windows.
+ ;; Guarded: on a machine without the binary the bare call-process signalled
+ ;; file-missing and aborted init.
+ (when (cj/executable-find-or-warn "gpg-connect-agent" "GPG pinentry GUI updates")
+ (call-process "gpg-connect-agent" nil nil nil "updatestartuptty" "/bye")))
;; ---------------------------------- Plstore ----------------------------------
;; Encrypted storage used by oauth2-auto for Google Calendar tokens.