From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Spiers Subject: Re: Re: skip-entry-if category Date: Mon, 2 Nov 2009 14:14:08 +0000 Message-ID: <20091102141408.GA32187@atlantic.linksys.moosehall> References: <87vdkg5xws.fsf@mean.albasani.net> <5B1DCDDC-405B-4D37-AD03-81F13FF00F7D@gmail.com> Reply-To: Adam Spiers Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N4xfn-0005Mj-GP for emacs-orgmode@gnu.org; Mon, 02 Nov 2009 09:14:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N4xfi-0005JR-MN for emacs-orgmode@gnu.org; Mon, 02 Nov 2009 09:14:18 -0500 Received: from [199.232.76.173] (port=39671 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4xfi-0005JJ-Du for emacs-orgmode@gnu.org; Mon, 02 Nov 2009 09:14:14 -0500 Received: from arctic.adamspiers.org ([212.13.194.176]:36557) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N4xfi-0000a0-5P for emacs-orgmode@gnu.org; Mon, 02 Nov 2009 09:14:14 -0500 Received: from localhost (dsl-217-155-199-114.zen.co.uk [217.155.199.114]) by arctic.adamspiers.org (Postfix) with ESMTP id 732752401B for ; Mon, 2 Nov 2009 14:14:13 +0000 (UTC) Content-Disposition: inline In-Reply-To: <5B1DCDDC-405B-4D37-AD03-81F13FF00F7D@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Carsten Dominik (carsten.dominik@gmail.com) wrote: > On Aug 22, 2009, at 2:47 PM, Matt Lundin wrote: > >Hi Memnon > > > >Memnon Anon wrote: > >>However, there is one thing I am not able to figure out: > >> > >>Using skipping, it is easy to limit my daily agenda to certain > >>tags like: > >>(org-agenda-skip-function '(org-agenda-skip-entry-if 'notregexp > >>":STUDIUM:")))) > >> > >>Is it possible to do the same with Categories? > >>I think there must be a way, but all my attempts did not work :(. > > > >I believe this is not possible with the built in org agenda skip > >functions, since they search only the text within the subtree and do > >not recognize inherited tags and properties. > > > >However, I suspect that one could build a skip function using > >org-entry-properties that would accomplish this goal. > > Much faster in this special case will be to use `org-get-category' > instead of accessing all properties of the entry with > org-entry-properties. I wrote the following to accomplish this, but it would be much nicer if you could use (org-agenda-skip-entry-if 'category "mycategory"). (defun org-agenda-skip-select-category-function (category-to-select) "Creates a function suitable for use with `org-agenda-skip-function' which skips all items except for those in the provided category." `(lambda () (if (equal (org-get-category) ,category-to-select) nil ;; don't skip ;; The invisible-ok param below seems to be needed ;; in order to avoid infinite loops: (org-end-of-subtree t))))