From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Riley Subject: refiling : limiting the destination refile targets Date: Wed, 27 Jan 2010 03:11:56 +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 1NZxOO-0001md-OJ for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 21:12:28 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZxOK-0001mH-38 for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 21:12:28 -0500 Received: from [199.232.76.173] (port=59972 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZxOJ-0001mE-Ss for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 21:12:23 -0500 Received: from lo.gmane.org ([80.91.229.12]:50694) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NZxOJ-0000yx-IT for emacs-orgmode@gnu.org; Tue, 26 Jan 2010 21:12:23 -0500 Received: from list by lo.gmane.org with local (Exim 4.50) id 1NZxOD-0000uE-RO for emacs-orgmode@gnu.org; Wed, 27 Jan 2010 03:12:17 +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 ; Wed, 27 Jan 2010 03:12:17 +0100 Received: from rileyrgdev by 85.183.18.158 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Jan 2010 03:12:17 +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 Here is a slight extension of the previously discussed ability to restrict what are considered valid refile targets. You can simply modify the restricted list org-no-refile-targets (which can be a list as below or simply a string tag such as "norefile". ,---- | (defun org-contains-tags (tags) | "returns t if the currnt org item is tagged with tags wher tags can be a single tag or a list of tags" | (interactive) | (let ((matched nil) | (tagslist (org-split-string (org-get-tags-string) ":"))) | (when tagslist | (if (nlistp tags) | (setq matched (member tags tagslist)) | (catch 'break | (dolist(tag tags) | (if(member tag tagslist) | (progn (setq matched t) | (throw 'break t))))))) | matched)) | | (defvar org-no-refile-tags `("NOTE" ,org-archive-tag) "org items | containing one of these tags will not be considered for refile targets") | (setq org-refile-target-verify-function `(lambda()(not(org-contains-tags org-no-refile-tags)))) `---- As an elisp beginner, it pains me to tell you it took me about 2 hours to get the right quoting sequences for the org-archive-tag to evaluate properly .... I have significantly less hair now ... ;) r.