summary refs log tree commit diff stats
path: root/emacs
diff options
context:
space:
mode:
authorAlan Pearce2017-09-13 09:50:54 +0200
committerAlan Pearce2017-09-13 09:50:54 +0200
commit04cdd29bdd9ecc2fc04b7082c297bd6a68770ce4 (patch)
treecbf425c0c622f384446c8565953c0b6fb5691ab5 /emacs
parentab4e4771ec8b2cc1e714384f008f63f29d602beb (diff)
downloadnixfiles-04cdd29bdd9ecc2fc04b7082c297bd6a68770ce4.tar.lz
nixfiles-04cdd29bdd9ecc2fc04b7082c297bd6a68770ce4.tar.zst
nixfiles-04cdd29bdd9ecc2fc04b7082c297bd6a68770ce4.zip
Emacs: Make sure pre-set SSH_AUTH_SOCK exists before using it
Diffstat (limited to 'emacs')
-rw-r--r--emacs/.emacs.d/main.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/emacs/.emacs.d/main.el b/emacs/.emacs.d/main.el
index 0e15840d..cc4e819e 100644
--- a/emacs/.emacs.d/main.el
+++ b/emacs/.emacs.d/main.el
@@ -833,7 +833,8 @@
 (use-package tramp
   :defer 7
   :config (progn
-            (unless (getenv "SSH_AUTH_SOCK")
+            (unless (and (getenv "SSH_AUTH_SOCK")
+                         (file-exists-p (getenv "SSH_AUTH_SOCK")))
               (setenv "SSH_AUTH_SOCK" (format "/run/user/%s/gnupg/S.gpg-agent.ssh" (user-uid))))
             (setq tramp-default-method "ssh"
                   tramp-default-user-alist '(("\\`su\\(do\\)?\\'" nil "root"))