From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Riley Subject: Re: Make archived headers unavailable as refile targets? Date: Tue, 26 Jan 2010 17:27:36 +0100 Message-ID: References: <878wbmpj9o.fsf@gmail.com> <6f9073781001260718o4504e914ma74f32eb3ed3b07e@mail.gmail.com> 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 1NZoH0-0005mh-Hx for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 11:28:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZoGv-0005fY-K4 for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 11:28:14 -0500 Received: from [199.232.76.173] (port=47442 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZoGv-0005f5-9q for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 11:28:09 -0500 Received: from lo.gmane.org ([80.91.229.12]:42286) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NZoGu-00077c-RY for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 11:28:09 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1NZoGr-0002qE-Cl for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 17:28:05 +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 ; Tue, 26 Jan 2010 17:28:05 +0100 Received: from rileyrgdev by 85.183.18.158 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 26 Jan 2010 17:28:05 +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 Paul Mead writes: > 2010/1/26 Carsten Dominik : > >> >> Take a look at the variable `org-refile-target-verify-function'. >> >> HTH >> >> - Carsten >> >> > Thanks Carsten, I've had a look at the variable and the customize > option for it and I'm afraid I don't understand how to use it for my > task. I'm afraid my elisp skills aren't up to much. Do I enter the > name of a function and defun it somewhere else? > > I'm assuming that I write a function which tests whether a headline > has an ARCHIVE tag and return nil if that's the case - is that right? There might be easier ways, but as I'm familiarising myself more with elisp, here's one solution: ,---- | (defun org-contains-tag (tag) | (interactive) | (let* ((tagslist (org-split-string (org-get-tags-string) ":"))) | (if tagslist (or (member tag tagslist) (member (upcase tag) tagslist)) nil))) | | (defun org-not-archived () (not (org-contains-tag "archive"))) | | (setq org-refile-target-verify-function 'org-not-archived) | | ;; (global-set-key (kbd "C-c p") (lambda()(interactive)(message "Tag contains %s : %s" "archive" (if (org-contains-tag "archive")"yes" "no")))) `---- regards r. > > Paul > > _______________________________________________ > 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 > -- Google Talk : rileyrgdev@googlemail.com http://www.google.com/talk ASCII ribbon campaign ( ) - against HTML email X & vCards / \