summary refs log tree commit diff stats
path: root/tag-emacs
diff options
context:
space:
mode:
authorAlan Pearce2017-03-07 16:30:48 +0100
committerAlan Pearce2017-03-07 16:30:48 +0100
commitd1bf36ed1e8dc1a3ec5d2a99aa6d335dd3381246 (patch)
treefc4e5c66515cecb21c77cba810785f3664a9c097 /tag-emacs
parent3eb1cb331f686b37d752bdfbb690631eae2df4db (diff)
downloaddotfiles-d1bf36ed1e8dc1a3ec5d2a99aa6d335dd3381246.tar.lz
dotfiles-d1bf36ed1e8dc1a3ec5d2a99aa6d335dd3381246.tar.zst
dotfiles-d1bf36ed1e8dc1a3ec5d2a99aa6d335dd3381246.zip
Emacs: Fix loading private elisp
Diffstat (limited to 'tag-emacs')
-rw-r--r--tag-emacs/emacs.d/init.org17
1 files changed, 7 insertions, 10 deletions
diff --git a/tag-emacs/emacs.d/init.org b/tag-emacs/emacs.d/init.org
index d0bc299..e8557f3 100644
--- a/tag-emacs/emacs.d/init.org
+++ b/tag-emacs/emacs.d/init.org
@@ -1261,8 +1261,7 @@ rather useful.
 ** Auxillary Configuration
 
 #+BEGIN_SRC emacs-lisp
-;; (require 'pinentry)
-;; (require 'epa)
+(require 'pinentry)
 
 (defvar have-private-key
   (file-exists-p (expand-file-name "secring.gpg" "~/.gnupg/")))
@@ -1293,24 +1292,22 @@ rather useful.
     (unless (getenv "GPG_AGENT_INFO")
       (start-process "gpg-agent" nil "gpg-agent" "--daemon")
       (setenv "SSH_AUTH_SOCK" gpg-agent-ssh-sock))
-    (setq password-cache-expiry nil
-          pinentry--socket-dir temporary-file-directory)
+    (setq password-cache-expiry nil)
     (unless (file-exists-p (concat pinentry--socket-dir "pinentry"))
       (pinentry-start)
       (add-hook 'kill-emacs-hook 'pinentry-stop))
     (add-to-list 'load-suffixes ".el.gpg")
-    (load-gpg "private")
-    (kill-buffer "*Pinentry*")))
+    (load-gpg (expand-file-name "private" user-emacs-directory))))
 
 (defun first-frame-hook (frame)
-  (remove-hook 'after-make-frame-functions 'first-frame-hook)
+  (remove-hook 'after-make-frame-functions #'first-frame-hook)
   (run-at-time nil nil 'load-private-data))
 
-(add-hook 'after-make-frame-functions 'first-frame-hook)
+(if (eq 1 (length (frame-list)))
+    (add-hook 'after-init-hook #'load-private-data)
+  (add-hook 'after-make-frame-functions #'first-frame-hook))
 #+END_SRC
 
-
-
 * Minibuffer
 
 Sometimes I want to use the minibuffer, but I’m already inside it.