3

I am looking for Emacs password manager, and org-password-manager looks nice for my needs.

But when I am trying to open created passwords.org.gpg file (I use symmetric encryption for more ease), Emacs each time show me a pop-up windows, asking my passphrase. Is it possible to use minibuffer for this (instead of pop-up window)?

enter image description here

I have (setq use-dialog-box nil) in my .emacs file, but it does not help in this case.

  • Are you running (epa-file-enable) in your init file? – Jules Mar 7 '16 at 15:45
  • @JulesTamagnan, yes, I have that line in my .emacs file. – drobnbobn Mar 7 '16 at 15:48
  • I think for opening files in emacs thats all I needed. I also have a bit in my bashrc that I haven't touched in a while so that may help. Also for programs that are not related to emacs I use github.com/ecraven/pinentry-emacs to route the password selection to my minibuffer – Jules Mar 7 '16 at 15:53
  • Is this by any chance the askpass program pop-up window? If so, the simplest solution is to uninstall askpass or friends (KDE has its own version of it). When this program is installed many other programs which require authentication will use it to collect user's credentials, which is generally not what you expect from Emacs. – wvxvw Mar 7 '16 at 15:56
  • @wvxvw I use Xfce and have KeePass2 and KeePassX both installed, but I don't find askpass on my PC. Should I uninstall them? Also: I added image to my post with asking-pop-up. – drobnbobn Mar 7 '16 at 16:12
3

I am moving my comment to an answer explaining how pinentry-emacs works because of formatting

pinentry-emacs stops the window from popping up that asks for your password and insteads asks for your password through the minibuffer.

It is super poorly documented and took me a bit of time to set up. From what I can tell I placed

(pinentry-start)
(defun pinentry-emacs (desc prompt ok error)
  (let ((str (read-passwd (concat (replace-regexp-in-string "%22" "\"" (replace-regexp-in-string "%0A" "\n" desc)) prompt ": "))))
    str))

into my init file and then I put

pinentry-program /home/--name--/.emacs.d/dotEmacs/pinentry/pinentry-emacs

into ~/.gnupg/gpg-agent.conf

After that you may need to restart your computer, or just the gpg-agent.

  • What if I have no gpg-agent.conf file in my ~/.gnupg/ directory? Also: does pinentry-emacs hide asking password in minibuffer with asterisk symbols? – drobnbobn Mar 7 '16 at 17:01
  • 1
    You can create the file with only that inside of it. Yes it does! – Jules Mar 7 '16 at 17:02
  • It works for me! Now I can use minibuffer for that task! But now every time I start Emacs it shows error: Warning (initialization): An error occurred while loading /home/user/.emacs: Symbol's function definition is void: pinentry-start. What there may be the cause? – drobnbobn Mar 7 '16 at 17:23
  • Hm.. removing (pinentry-start) from .emacs file fixed this error. Also there there is no such line in documentation github.com/ecraven/pinentry-emacs. All is OK now! – drobnbobn Mar 7 '16 at 17:31
  • 1
    I think that (pinentry-start) should be built-into emacs if your version is sufficently new. Otherwise you can download it through elpa! Anyways I'm glad it works! – Jules Mar 7 '16 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.