From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: alter all subtrees containing specific tag Date: Sun, 8 Mar 2009 14:29:57 +0100 Message-ID: References: <877i303a9w.fsf@it.com> Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LgJ4v-0005sK-Cb for emacs-orgmode@gnu.org; Sun, 08 Mar 2009 09:30:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LgJ4s-0005rz-Me for emacs-orgmode@gnu.org; Sun, 08 Mar 2009 09:30:05 -0400 Received: from [199.232.76.173] (port=57322 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LgJ4s-0005rs-Jq for emacs-orgmode@gnu.org; Sun, 08 Mar 2009 09:30:02 -0400 Received: from nf-out-0910.google.com ([64.233.182.189]:25747) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LgJ4r-0004Sh-Tv for emacs-orgmode@gnu.org; Sun, 08 Mar 2009 09:30:02 -0400 Received: by nf-out-0910.google.com with SMTP id b11so183241nfh.26 for ; Sun, 08 Mar 2009 06:29:59 -0700 (PDT) In-Reply-To: <877i303a9w.fsf@it.com> 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: news@aleblanc.cotse.netnews@aleblanc.cotse.net Cc: emacs-orgmode@gnu.org On Mar 8, 2009, at 5:31 AM, wrote: > Hi, > I use pgg to encrypt some org subtrees (e.g. the ones containing > passwords). At the moment I have to encrypt/decrypt them one at a > time by selecting the appropriate region and running > pgg-encrypt-region/pgg-decrypt-region. > I want to make a function that will automatically encrypt/decrypt > all > subtrees (in the current buffer) whose headings contain > an :ENCRYPT: tag. > I tried using org-map-entries, but it seems to restore the buffer to > its original state after returning. No, org-map-entries should be perfect for this, and it does not restore the buffer. This should really well. The only thing that might happen, by replacing the subtree, that it does not know correctly where to continue and therefore it might do every tree twice? > 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