summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2017-03-10 13:08:29 +0100
committerAlan Pearce2017-03-10 13:08:29 +0100
commit99e39b728189d9c7069de92c4cd84be1576dd377 (patch)
tree4748765493250e897c8133b0ba9f70a5f8459916
parent51eff2f0c46f9bbcb8a4ef02d434702d8f6c4053 (diff)
downloaddotfiles-99e39b728189d9c7069de92c4cd84be1576dd377.tar.lz
dotfiles-99e39b728189d9c7069de92c4cd84be1576dd377.tar.zst
dotfiles-99e39b728189d9c7069de92c4cd84be1576dd377.zip
Emacs: Check for SSH environment before starting gpg-agent
-rw-r--r--tag-emacs/emacs.d/init.org3
1 files changed, 2 insertions, 1 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index df5069c..ca111af 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -1289,7 +1289,8 @@ rather useful.
   (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)