[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Exclude tag from custom agenda

From: Memnon Anon
Subject: Re: [O] Exclude tag from custom agenda
Date: Sun, 9 Dec 2012 15:59:48 +0000 (UTC)

Karl Voit <address@hidden> writes:

> What I want to achieve: on top, there should be my normal agenda
> (events, tasks, habits, ...) but minus elements tagged with
> "reward".
> I think, that «(agenda "" nil)» has to be modified but I don't know
> how.

I'm in a hurry, but lets see if I can give you something in 5 minutes.
We need a skip-by-tag function. gmane should help here

Mike McLean posted one in 2011, which still seems to work.
Lets make that a little more general:

#+begin_src emacs-lisp
;;; Based on http://article.gmane.org/gmane.emacs.orgmode/41427
  (defun my-skip-tag(tag)
    "Skip entries that are tagged TAG"
    (let* ((entry-tags (org-get-tags-at (point))))
      (if (member tag entry-tags)
          (progn (outline-next-heading) (point))

Now, (agenda "" nil) should be:

#+begin_src emacs-lisp
(agenda "" 
 ((org-agenda-skip-function '(my-skip-tag"reward"))
  (org-agenda-overriding-header "Agenda (without rewards: ")))))

That should do it.
Please give it a try :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]