[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] refiling : limiting the destination refile targets
From: |
Richard Riley |
Subject: |
[Orgmode] refiling : limiting the destination refile targets |
Date: |
Wed, 27 Jan 2010 03:11:56 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
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.
- [Orgmode] refiling : limiting the destination refile targets,
Richard Riley <=