Notmuch: Unlock GPG on demand in the foreground.
parent
d031411717
commit
65e0fdf80d
|
@ -86,4 +86,17 @@
|
|||
|
||||
;; (advice-add 'debbugs-gnu-select-report :override #'debbugs-notmuch-select-report)
|
||||
|
||||
;; TODO: This is a bit brittle since it only works if ~/.authinfo.gpg exists.
|
||||
;; Is there a way to unlock gpg manually without a file?
|
||||
(defun ambrevar/gpg-unlock ()
|
||||
"Unlock GPG."
|
||||
(let ((sentinel (lambda (_process _args)
|
||||
(notmuch-poll)
|
||||
(notmuch-refresh-this-buffer))))
|
||||
(make-process :name "gpg" :buffer nil
|
||||
:command (list "gpg" "--decrypt" (expand-file-name "~/.authinfo.gpg"))
|
||||
:sentinel sentinel)))
|
||||
|
||||
(advice-add 'notmuch-poll-and-refresh-this-buffer :override #'ambrevar/gpg-unlock)
|
||||
|
||||
(provide 'init-notmuch)
|
||||
|
|
Loading…
Reference in New Issue