From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Riley Subject: Enhancement : crypt and org-ctrl-c Date: Mon, 25 Jan 2010 19:51:18 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZU2R-0006b7-Qt for emacs-orgmode@gnu.org; Mon, 25 Jan 2010 13:51:51 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZU2M-0006Vn-JR for emacs-orgmode@gnu.org; Mon, 25 Jan 2010 13:51:50 -0500 Received: from [199.232.76.173] (port=56833 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZU2M-0006Vj-F3 for emacs-orgmode@gnu.org; Mon, 25 Jan 2010 13:51:46 -0500 Received: from lo.gmane.org ([80.91.229.12]:42058) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NZU2M-00053Y-1Y for emacs-orgmode@gnu.org; Mon, 25 Jan 2010 13:51:46 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1NZU2G-0004FD-SB for emacs-orgmode@gnu.org; Mon, 25 Jan 2010 19:51:40 +0100 Received: from 85.183.18.158 ([85.183.18.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 25 Jan 2010 19:51:40 +0100 Received: from rileyrgdev by 85.183.18.158 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 25 Jan 2010 19:51:40 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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 : rileyrgdev@googlemail.com http://www.google.com/talk ASCII ribbon campaign ( ) - against HTML email X & vCards / \