[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: Make archived headers unavailable as refile targets?
From: |
Richard Riley |
Subject: |
[Orgmode] Re: Make archived headers unavailable as refile targets? |
Date: |
Tue, 26 Jan 2010 17:27:36 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Paul Mead <address@hidden> writes:
> 2010/1/26 Carsten Dominik <address@hidden>:
>
>>
>> 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.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
--
Google Talk : address@hidden http://www.google.com/talk
ASCII ribbon campaign ( )
- against HTML email X
& vCards / \