[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-crypt doesn't automatically encrypt on save

From: Rémi Letot
Subject: Re: [O] org-crypt doesn't automatically encrypt on save
Date: Fri, 12 Sep 2014 12:42:29 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Darlan Cavalcante Moreira <address@hidden> writes:

> You need to load org-crypt and call org-crypt-use-before-save-magic
> before you open the org file.

I have this in my config:

  (add-to-list 'org-modules 'org-crypt)
  (require 'org-crypt)

So I think that's what is done. I also checked org-mode-hook on a fresh
start of emacs, and it does include a stanza for
org-encrypt-entries. C-h v org-mode-hook begins with this:

Value: (#[nil "\300\301\302\303\304$\207"
       [org-add-hook before-save-hook org-encrypt-entries nil t]

So I think that part is ok.

Now I visit a new file, say test.org, which doesn't exist yet. I create
one heading with a bit of content, tag it as :crypt:, and save the
file. Bam, it's not encrypted.

Now I call M-x org-encrypt-entries, and the heading is encrypted. So
org-crypt does work, I can decrypt and encrypt headings manually, but it
won't do it automatically. And indeed, before-save-hook is nil in a
fresh org file and stays so when I visit an org file.

Now I call M-x org-mode on that file, add a space so it is modified and
I can save it, call C-x C-s, and it is encrypted as it should. org-mode
set before-save-hook to (org-encrypt-entries t) as it should. Only I
have to manually call org-mode once the file is open, it won't do it

I C-x k the file, re-visit it, and I have to call M-x org-mode on it
again before it will automatically encrypt the headings. All other
org-mode functionnality seems to work fine.

Any idea ?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]