|Subject:||Re: [Orgmode] [ANN] org-crypt version 0.2|
|Date:||Thu, 2 Apr 2009 09:52:25 +0200|
this looks really nice. I very much like the idea using a property
to set an encryption key.
On Apr 2, 2009, at 5:19 AM, Peter Jones wrote:
Below is a patch which will fix this. Basically you need to
go back and fix the visibility of the entry, because you are
inserting in a location that confuses the invisibility code.
Instead of trying to get the insertion right, it is much better
to reset it for the entire tree.
The patch also does one other thing:
It makes encryption cover the entire subtree of an entry
with tag :crypt:, not just the text up to first child.
I believe this is more consistent with the structure or
Org-mode files. Would you agree?
--- org-crypt.el.orig 2009-04-02 08:35:24.000000000 +0200
+++ org-crypt.el 2009-04-02 08:46:59.000000000 +0200
@@ -101,12 +101,16 @@
- (let ((epg-context (epg-make-context nil t t))
+ (let ((folded (org-invisible-p))
+ (epg-context (epg-make-context nil t t))
(when (and (not (looking-at "-----BEGIN PGP MESSAGE-----"))
- (or (outline-next-heading) (bolp)))
+ (org-end-of-subtree t t)
(setq end (point)
@@ -115,6 +119,10 @@
(epg-list-keys epg-context crypt-key)))
(delete-region beg end)
+ (when folded
+ (org-back-to-heading t)
(defun org-decrypt-entry ()
|[Prev in Thread]||Current Thread||[Next in Thread]|