Carsten Dominik <domi...@science.uva.nl> writes: >> Is there a quick way to get the start and end points of a subtree, >> or >> place region around it? and a quick way to jump to the next heading >> with a given tag? > > (org-mark-subtree) ;; this will include the headline > > (re-search-forward "^\\*+ .*?:ENCRYPT:" nil t) > > - Carsten
Just discovered a bug in my previously posted function. It doesn't work too well if you have lower level subtrees tagged for encryption. Here is the fixed version: (defun aleblanc-org-toggle-encryption (rcpts passphrase) (interactive (list (split-string (read-string "Recipients (default is none): ") "[ \t,]+") (pgg-read-passphrase "GnuPG passphrase: "))) (show-all) (org-map-entries '(let (start end teststring) (org-outline-level) (next-line) (org-beginning-of-line) (setq start (point)) (setq teststring (buffer-substring start (+ start 27))) (outline-get-next-sibling) (if (not (equal (point) (point-max))) (previous-line)) (org-end-of-line) (setq end (point)) (if (equal teststring "-----BEGIN PGP MESSAGE-----") (if (pgg-decrypt-region start end passphrase) (pgg-display-output-buffer start end t) (message "Can't decrypt region!")) (if (equal rcpts '("")) (pgg-encrypt-symmetric-region start end passphrase) (pgg-encrypt-region start end rcpts nil passphrase)) (pgg-display-output-buffer start end t))) "+ENCRYPT")) -- aleblanc _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode