emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Richard Riley <rileyrgdev@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: refiling : limiting the destination refile targets
Date: Wed, 27 Jan 2010 14:16:18 +0100	[thread overview]
Message-ID: <307C59F4-7249-4003-9720-16CB1EC3A37D@gmail.com> (raw)
In-Reply-To: <hjo7dc$2oa$1@ger.gmane.org>

Hi Richard,

On Jan 27, 2010, at 3:11 AM, Richard Riley wrote:

>
> 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.

You can also use the function org-get-local-tags to get the tags.

Your variable definition can be simplified to

     (defvar org-no-refile-tags (list "NOTE" org-archive-tag))

- Carsten

      reply	other threads:[~2010-01-27 13:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-27  2:11 refiling : limiting the destination refile targets Richard Riley
2010-01-27 13:16 ` Carsten Dominik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=307C59F4-7249-4003-9720-16CB1EC3A37D@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=rileyrgdev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).