Paul Mead <paul.d.m...@googlemail.com> writes:

> 2010/1/26 Carsten Dominik <carsten.domi...@gmail.com>:
>
>>
>> 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 : rileyrg...@googlemail.com  http://www.google.com/talk
ASCII ribbon campaign ( )
 - against HTML email  X
             & vCards / \



_______________________________________________
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

Reply via email to