all repos — nixfiles @ 04cdd29bdd9ecc2fc04b7082c297bd6a68770ce4

System and user configuration, managed by nix and home-manager

Emacs: Make sure pre-set SSH_AUTH_SOCK exists before using it
Alan Pearce alan@alanpearce.eu
Wed, 13 Sep 2017 09:50:54 +0200
commit

04cdd29bdd9ecc2fc04b7082c297bd6a68770ce4

parent

ab4e4771ec8b2cc1e714384f008f63f29d602beb

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

jump to
M emacs/.emacs.d/main.elemacs/.emacs.d/main.el
@@ -833,7 +833,8 @@ ;; #+BEGIN_SRC emacs-lisp (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"))