From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps Date: Wed, 25 Nov 2015 13:58:23 +0100 Message-ID: <87ziy28ccw.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54758) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1Zcl-0002XA-T8 for emacs-orgmode@gnu.org; Wed, 25 Nov 2015 07:56:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1Zch-0000jN-Rw for emacs-orgmode@gnu.org; Wed, 25 Nov 2015 07:56:39 -0500 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:59540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1Zch-0000jH-LL for emacs-orgmode@gnu.org; Wed, 25 Nov 2015 07:56:35 -0500 In-Reply-To: ("Gustav \=\?utf-8\?Q\?Wikstr\=C3\=B6m\=22's\?\= message of "Wed, 25 Nov 2015 12:20:30 +0000") 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: Gustav =?utf-8?Q?Wikstr=C3=B6m?= Cc: "sgeorgii ." , "emacs-orgmode@gnu.org" Hello, Gustav Wikstr=C3=B6m writes: > Patch attached. Thank you. A minor comment below. > From 445995e1fad646b2b22c014e09e3e05a7aeeede1 Mon Sep 17 00:00:00 2001 > From: Gustav Wikstrom > Date: Wed, 25 Nov 2015 13:06:31 +0100 > Subject: [PATCH] org-agenda: Filter empty tags > > * lisp/org-agenda.el (org-agenda-filter-make-matcher-tag-exp): Deal with > the case when the user provided an empty string to filter or exclude > rows from the agenda. Please provide a reference to the discussion that lead to this patch. > (let* ((tag (substring x 1)) > - (isregexp (and (equal "{" (substring tag 0 1)) > + (isemptystring (string=3D "" tag)) > + (isregexp (and (not isemptystring) > + (equal "{" (substring tag 0 1)) > (equal "}" (substring tag -1)))) > regexp) > (cond > (isregexp > (setq regexp (substring tag 1 -1)) > (setq f1 (list 'org-match-any-p regexp 'tags))) > + (isemptystring > + (setq f1 '(not tags))) > (t > (setq f1 (list 'member (downcase tag) 'tags)))) > (when (eq op ?-) Nitpick time: You don't need isemptystring if it is the first branch in cond (cond ((string=3D "" tag) (setq f1 '(not tags))) (isregexp ...) (t ...)) Obviously, in that case, you don't need to change isregexp at all. Regards, --=20 Nicolas Goaziou 0x80A93738