Carsten,

This adds ctrl-c ctrl-c context sensitive processing to pgp blocks
created by org-crypt.

I wasnt entirely sure where to put the regexp func so, since its so
small with the crypt patch, I submit it "neat" rather than as a diff. I
didnt spot another org func which does the same thing. Hopefully not a
duplicate.

regards,

r.

,----
|   ; this small routine is handy for all "context" commands I think.
|   (defun pointInRegExp (startRE endRE)
|     "returns t if the current point is within a block represented by the reg 
exp pairing of startRE and endRE"
|     (interactive)
|     (let ((p (point)))
|       (save-excursion
|         (and (re-search-backward startRE nil t) (re-search-forward endRE nil 
t) (>= (point) p)))));
|   
|   ; inside a pgp block in org? if so then decrypt it.
|   (defun org-ctrl-c-encrypted ()
|     (interactive)
|     (if (pointInRegExp 
|      "^-----BEGIN PGP MESSAGE-----" 
|      "^-----END PGP MESSAGE-----")
|     (org-decrypt-entry) nil))
|   
|   ; add crypt decryption to org-mode context sensitive processing.
|   (add-hook 'org-ctrl-c-ctrl-c-hook 'org-ctl-c-encrypted)
`----

Seems to work fine. Only issue is that after decryption it then things
its on a tag line - not sure if thats to do with where the point
goes after decryption.

-- 
Google Talk : rileyrg...@googlemail.com  http://www.google.com/talk
ASCII ribbon campaign ( )
 - against HTML email  X
             & vCards / \



_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to