* lisp/org-crypt.el (org-crypt-check-auto-save): New function, see next change.
* lisp/org-crypt.el (org-decrypt-entry): Break the auto-save-mode check out
into a separate function, and call it at a later point, to assure it only
runs when visiting an encrypted entry.
Currently `org-decrypt-entry' is doing the auto-save-mode check whenever
it's run, regardless of context, while this only makes sense when run on
an entry which is actually encrypted (or looks like it, at least).
TINYCHANGE
Also remove blank lines before the ";;; org*el ends here" declarations.
Having a "Version" header forced us to update every file when releasing a
new version of Org; it also forced us to update every file when merging Org
with Emacs trunk, thus cluttering the diffs between the previously merged
version and the new one with useless information.
Glenn Morris suggested this in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00322.html
As auto-save-mode can only cause leakage when there's actual decrypted
data lying around, don't check for it (and potentially cause annoyance)
on init, but only when org-decrypt-entry is called.
* lisp/org-crypt.el:
- add defcustom `org-crypt-disable-auto-save'
- `org-decrypt-entry': before decrypting, check whether
`auto-save-mode' is enabled for the current buffer, and act
on it according to how `org-crypt-disable-auto-save' is set.
- remove comment re "encrypt[ing] Org auto-saved buffers"
- remove on-init check for `auto-save-default'
* lisp/org-crypt.el (org-encrypt-string): New function.
(org-encrypt-entry): Use org-encrypt-string to encrypt, so we use cached
crypted values.
(org-decrypt-entry): Store crypted text in decrypted text.
Signed-off-by: Julien Danjou <julien@danjou.info>
* org-crypt.el (org-decrypt-entry): Delete \n on top level heading.
This avoids a display bug showing the heading outlined where the text
is not since it does not have the outline property.
Restore subtree visibility state after decryption.
Cc: John Wiegley <johnw@gnu.org>
Cc: Peter Jones <pjones@pmade.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
I just found a left over in org-list.el. :)
Updated patch attached.
>From bf6c65a42e04d4753c58795442a479685bb5f318 Mon Sep 17 00:00:00 2001
From: Julien Danjou <julien@danjou.info>
Date: Wed, 26 Jan 2011 11:14:11 +0100
Subject: [PATCH] org: remove org-invisible-p
* org.el: Remove org-invisible-p: outline-invisible-p is
available in Emacs 22 and in recent XEmacs 21. Replace in
various files.
Signed-off-by: Julien Danjou <julien@danjou.info>
This patch makes some straightforward corrections to a number of
docstrings. Each change is normally to:
- correct a typo, or
- fix up hyperlinks to function or variable names, or
- ensure slightly better conformance with the documentation guidelines
and tips given in the Elisp manual
No attempt is made to provide missing docstrings or document arguments.
Cheers,
Phil
Patch by Peter Jones, following a bug report by Xiao-Jong Jin, who wrote:
> If you have the follow org file
>
> * test crypt :crypt:
> ** subheading 1
> text 1
> ** subheading 2
> text 2
>
> with setup as
>
> (require 'org-crypt)
> (setq org-tags-exclude-from-inheritance '("crypt"))
> (setq org-crypt-key "CBC0714E") ; my key
>
> On calling org-encrypt-entry on the first head line, only
> subheading 1 get encrypted, subheading 2 remains plain text.
> But, if you add an empty line or some text under the first
> heading, both subheading 1 and 2 are encrypted.