From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: Re: org-agenda-custom-commands with org-agenda-filter-by-regexp Date: Thu, 20 Aug 2015 09:29:12 -0500 Message-ID: <87mvxmnidj.fsf@fastmail.fm> References: <87io8b5l0p.fsf@linux.site> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38840) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSQqF-0003vO-Kg for emacs-orgmode@gnu.org; Thu, 20 Aug 2015 10:29:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZSQqA-0003iK-Ih for emacs-orgmode@gnu.org; Thu, 20 Aug 2015 10:29:19 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:36771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZSQqA-0003iC-74 for emacs-orgmode@gnu.org; Thu, 20 Aug 2015 10:29:14 -0400 In-Reply-To: <87io8b5l0p.fsf@linux.site> (Tory S. Anderson's message of "Wed, 19 Aug 2015 09:57:10 -0600") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Tory S. Anderson" Cc: orgmode list torys.anderson@gmail.com (Tory S. Anderson) writes: > I've previously had success with using > `org-agenda-tag-filter-preset` in `org-agenda-custom-commands` but > I wanted to include OR logic on two different tags, which seemed > beyond th tag-filter (which seems to use AND logic). In my agenda > view I can use `=` to use a conditional on two tags, but I can't > seem to duplicate that behavior in a custom command. With no > errors it simply doesn't seem to work, and googling around has > proved fruitless for giving examples; I've tried a number of > different syntax without effect. > > (setq org-agenda-custom-commands > '(("w"."Work") > ("wd" "Work Day" > ((agenda "" ((org-agenda-span 1) > (org-agenda-start-on-weekday nil) > (org-agenda-filter-by-regexp > '(":\\(ODH\)\\|\\(AGENDA\\):")))))))) > > > What's the proper way to get a working regexp filter in my > custom-command? Thanks! I think the regexp above is not correct. It's missing a backward slash after ODH (and contains an redundant set of parentheses). But even the regexp were correct, it wouldn't work, since org-agenda-filter-by-regexp is designed to be used interactively. Its parameter is a prefix argument, not a list or string. I think you need a skip function here: (setq org-agenda-custom-commands '(("w"."Work") ("wd" "Work Day" ((agenda "" ((org-agenda-span 1) (org-agenda-start-on-weekday nil) (org-agenda-skip-function '(org-agenda-skip-entry-if 'notregexp ":\\(ODH\\|AGENDA\\):")))))))) Matt