all repos — archive/dotfiles @ 99e39b728189d9c7069de92c4cd84be1576dd377

Superseded by nixfiles

Emacs: Check for SSH environment before starting gpg-agent
Alan Pearce alan@alanpearce.uk
Fri, 10 Mar 2017 13:08:29 +0100
commit

99e39b728189d9c7069de92c4cd84be1576dd377

parent

51eff2f0c46f9bbcb8a4ef02d434702d8f6c4053

1 files changed, 2 insertions(+), 1 deletions(-)

jump to
M tag-emacs/emacs.d/init.orgtag-emacs/emacs.d/init.org
@@ -1289,7 +1289,8 @@ (defun load-private-data ()   (interactive)
   (if (not have-private-key)
       (message "ERROR: Private GPG key not found")
-    (unless (getenv "GPG_AGENT_INFO")
+    (unless (or (getenv "GPG_AGENT_INFO")
+                (getenv "SSH_AUTH_SOCK"))
       (start-process "gpg-agent" nil "gpg-agent" "--daemon")
       (setenv "SSH_AUTH_SOCK" gpg-agent-ssh-sock))
     (setq password-cache-expiry nil)