emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] Re: Switching between many contexts


From: Manuel Hermenegildo
Subject: Re: [Orgmode] Re: Switching between many contexts
Date: Tue, 3 Mar 2009 07:20:34 +0100

> For this you would indeed you a skip function.
>
> E.g.,
>
> --8<---------------cut here---------------start------------->8---
> (setq org-agenda-custom-commands
>      '(("A" agenda ""
>        ((org-agenda-skip-function '(org-agenda-skip-entry-if 'regexp  
> ":TAG:"))))))
> --8<---------------cut here---------------end--------------->8---

This is what I use as filter, which covers the issue of inheritance
and a small optimization (at least for my org files):

(defun my-skip-by-tags (tag)
  "Skip tasks except those that contain tag (with
inheritance!). "
  (let ((line-end (save-excursion (progn (end-of-line) (point))))) ;; return pos
    (if (or 
         (member tag (org-get-local-tags)) ;; check first if only local (speed)
         (member tag (org-get-tags-at (point)))) ;; also inherited
        nil ; do not skip
      line-end))) ; skip, continue after that

Cheers,

Manuel

-- 
-------------------------------------------------------------------------------
 Manuel Hermenegildo                     | Prof., C.S.Dept., T.U. Madrid (UPM)
 Director, IMDEA-Software and CLIP Group | +34-91-336-7435 (W) -352-4819 (Fax)
-------------------------------------------------------------------------------





reply via email to

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