0

I have a file located in the directory ~/myfiles/list.txt.gpg.

In the terminal, I type emacs ~/myfiles/list.txt.gpg and I get something that looks like this, which I'm guessing is the still encrypted form of the file.

In order to get it to display properly, I have to M-x revert-buffer, then it will prompt me for the password and load it the file properly.

My question is: How can I get Emacs to recognize it is encrypted and prompt me for the password immediately instead of having to go through the trouble of pressing M-x and selecting revert-buffer?

5
  • Did you load epa as documented in the wiki? emacswiki.org/emacs/EasyPG . Specifically:- (require 'epa-file) (epa-file-enable)
    – RichieHH
    Feb 2, 2020 at 20:21
  • I added this to my config but I get the same behavior, any other suggestions?
    – Hitomi86
    Feb 2, 2020 at 21:27
  • 1
    DId you restart your emacs after adding that to your config? If it still misbehaves, add just those two lines in a file (say /tmp/epa-config.el) and invoke emacs like this: emacs -Q -l /tmp/epa-config.el ~/myfiles/list.txt.gpg. This should work (in which case, you should figure out what in your config is creating the problem).
    – NickD
    Feb 2, 2020 at 23:09
  • Indeed that works! I guess that means something is wrong with my config.
    – Hitomi86
    Feb 3, 2020 at 2:05
  • Maybe you didnt evaluate them? Else follow NickD's advice. I shall make my comment an answer and please mark it as the answer. gnu.org/software/emacs/manual/html_node/efaq/…
    – RichieHH
    Feb 3, 2020 at 7:05

1 Answer 1

0

Did you load epa as documented in the wiki?

emacswiki.org/emacs/EasyPG . Specifically:-

(require 'epa-file)
(epa-file-enable) 

After that evaluate the code or restart. Refer to the emacs documentation for details on how to evaluate the code "in buffer".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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