Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs: Stop popup window for gpg passphrase [closed]

Tags:

emacs

elisp

emacs is annoyingly popping up window and asking for pass phrase whenever I open a encrypted file (somefile.gpg, .authinfo.gpg). I would like it instead ask me for password in minibuffer.

is there any configuration option for that.?

Edit: Important to note, if I press escape on popup window, emacs will ask for password in minibuffer. So there is fallback exist in emacs, I like to make that fallback method as first choice.

UPDATE: Emacs version: GNU Emacs 24.3.50.12 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.2) of 2013-05-28 on sealion

like image 326
kindahero Avatar asked May 30 '13 02:05

kindahero


2 Answers

Now I placed the following in .emacs which is finally disabling the gui prompt.

;; Do not use gpg agent when runing in terminal
(defadvice epg--start (around advice-epg-disable-agent activate)
  (let ((agent (getenv "GPG_AGENT_INFO")))
    (setenv "GPG_AGENT_INFO" nil)
    ad-do-it
    (setenv "GPG_AGENT_INFO" agent)))
like image 75
kindahero Avatar answered Oct 07 '22 01:10

kindahero


The comments on gpg-agent in C-h f epg-context-set-passphrase-callback RET look relevant, and I can see there is plenty of related discussion and apparent workarounds for this on the Emacs Wiki, under the heading "How to use a non-graphical password prompt for gpg":

http://emacswiki.org/emacs/EasyPG#toc4

like image 28
phils Avatar answered Oct 06 '22 23:10

phils