emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Richard Riley <rileyrgdev@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Enhancement : crypt and org-ctrl-c
Date: Mon, 25 Jan 2010 19:51:18 +0100	[thread overview]
Message-ID: <hjkp75$23d$1@ger.gmane.org> (raw)


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 / \

                 reply	other threads:[~2010-01-25 18:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='hjkp75$23d$1@ger.gmane.org' \
    --to=rileyrgdev@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).