From 40dd85a7a1ae2bd5d217eb294133fa2f7372691a Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Wed, 25 Oct 2017 19:12:52 +0100 Subject: [PATCH] Emacs: Move EPA config to main so that it's loaded in time by mu4e --- .emacs.d/lisp/init-eshell.el | 9 +++------ .emacs.d/lisp/init-mu4e.el | 3 +++ .emacs.d/lisp/main.el | 5 +++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.emacs.d/lisp/init-eshell.el b/.emacs.d/lisp/init-eshell.el index 46ccc005..87bbf282 100644 --- a/.emacs.d/lisp/init-eshell.el +++ b/.emacs.d/lisp/init-eshell.el @@ -6,6 +6,9 @@ ;;; modules, runs their hooks and concludes with `eshell-first-time-mode-hook' ;;; (for the first session only) and `eshell-mode-hook'. +;; Emacs pinentry for GPG. +(require 'main) + ;;; REVIEW: ANSI coloring goes wrong sometimes. Quite often with emerge/eix. ;;; Fixed in #27407. (require 'patch-eshell) @@ -100,12 +103,6 @@ ("sudo" "wifi-menu") ; Arch Linux ("sudo" "vi" "visudo")))) -;;; Support for Emacs' pinentry -;;; TODO: gpg-agent seems to be misconfigured for mu4e at least: -;;; See https://github.com/djcb/mu/issues/829. -(setq epa-pinentry-mode 'loopback) ; This will fail if gpg>=2.1 is not available. -(pinentry-start) - ;;; Alias management possibilities: ;;; - Version eshell-alias and store it in user-emacs-directory. Simplest and ;;; fastest, but aliases cannot be included conditionnaly, e.g. depending on the diff --git a/.emacs.d/lisp/init-mu4e.el b/.emacs.d/lisp/init-mu4e.el index 12ae039e..50749857 100644 --- a/.emacs.d/lisp/init-mu4e.el +++ b/.emacs.d/lisp/init-mu4e.el @@ -11,6 +11,9 @@ ;;; See https://github.com/djcb/mu/issues/454#issuecomment-320616279. ;;; TODO: should go to next link in text e-mails too. +;; Emacs pinentry for GPG. +(require 'main) + (when (require 'mu4e-maildirs-extension nil t) (mu4e-maildirs-extension)) diff --git a/.emacs.d/lisp/main.el b/.emacs.d/lisp/main.el index 925cbb33..2230a0ca 100644 --- a/.emacs.d/lisp/main.el +++ b/.emacs.d/lisp/main.el @@ -352,4 +352,9 @@ (when fortune (setq initial-scratch-message fortune))) +;;; Support for Emacs pinentry. +;;; Required for eshell/sudo and everything relying on GPG queries. +(setq epa-pinentry-mode 'loopback) ; This will fail if gpg>=2.1 is not available. +(pinentry-start) + (provide 'main)