I got ~/.authinfo.gpg to store my multiple email accounts for gnus, but if ~/.authinfo.gpg exists, the tramp won't work. It will always say:

Decrypting /home/chz/.authinfo.gpg...done

Emacs won't even load the file into Emacs. If I remove that file, the tramp will work fine and gnus will not work as I want.

The tramp configuration is like this page or this page(I've tried several versions, defun, defadvice, etc.), and the ~/.authinfo.gpg file contains lines of my emails accounts and machine localhost port sudo login root password my-password suggested by this page to edit file as root.

Even I don't use the tramp configuration mentioned above, just use C-x C-f /sudo::/etc/hosts, after I finished typing the second :, Decrypting /home/chz/.authinfo.gpg...done will automatically exist in minibuffer and stuck Emacs, then I have to C-g...

So how can I use edit-as-root and gnus at the same time?

Can I use other ways other than ~/.authinfo.gpg to store account info for my multiple emails accounts so edit-as-root will work too?



After testing my init.el piece by piece, it turned out that the which-function-mode and projectile don't work with tramp very well, I have to disable them when using tramp.

  • 1
    Can you reproduce this problem in emacs -q? If not, please post the part of your .emacs that would allow someone else to reproduce the problem. Which version of Emacs are you running? – Gilles 'SO- stop being evil' Dec 9 '14 at 8:45
  • 1
    I have a similar configuration and it works for me (tested again with Emacs 24.4 and 25.0.50). The only difference is the host name used in ~/.authinfo.gpg: machine hostname port sudo login root password my-password Note that I have used hostname (which is the real host name) instead of localhost. – Michael Albinus Dec 9 '14 at 10:44
  • @Gilles After emacs -q, M-x load-file /path/to/init-gnus.el, the C-x C-f /sudo::/etc/hosts works fine, and M-x gnus works as expected too. I guess I have to test my init.el piece by piece again. – CodyChan Dec 11 '14 at 7:44
  • @Gilles (which-function-mode 1) and projectile don't get along with tramp after I tested my init.el piece by piece. Disabling which-function-mode and projectile-global-mode when using tramp to solve this problem. – CodyChan Dec 11 '14 at 10:30
  • Nice progress. Please update your question, ideally with a minimal init.el that exhibits the problem. And tell us which Emacs version you're running. – Gilles 'SO- stop being evil' Dec 11 '14 at 10:49

Your Answer

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

Browse other questions tagged or ask your own question.