[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps
From: |
Gustav Wikström |
Subject: |
Re: [O] [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps |
Date: |
Wed, 25 Nov 2015 14:44:10 +0000 |
Hi, see below
> >
> > * 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.
The reference being the subject-line and date of the mail from sgeorgii?
>
> > (let* ((tag (substring x 1))
> > - (isregexp (and (equal "{" (substring tag 0 1))
> > + (isemptystring (string= "" 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= "" tag) (setq f1 '(not tags)))
> (isregexp ...)
> (t ...))
>
> Obviously, in that case, you don't need to change isregexp at all.
Hmm, since the error was thrown when trying to look at indexes outside of the
string in (substring ... ), I don't see how isregexp can be left as is. We have
to make sure the substring-code is not evaluated if the tag is empty. What am I
missing?
>
>
> Regards,
>
> --
> Nicolas Goaziou 0x80A93738
- [O] [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps, sgeorgii ., 2015/11/25
- Re: [O] [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps, Gustav Wikström, 2015/11/25
- Re: [O] [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps, sgeorgii ., 2015/11/25
- Re: [O] [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps, Gustav Wikström, 2015/11/25
- Re: [O] [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps, Nicolas Goaziou, 2015/11/25
- Re: [O] [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps,
Gustav Wikström <=
- Re: [O] [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps, Nicolas Goaziou, 2015/11/25
- Re: [O] [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps, Gustav Wikström, 2015/11/25
- Re: [O] [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps, sgeorgii ., 2015/11/26
- Re: [O] [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps, Nicolas Goaziou, 2015/11/26
- Re: [O] [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps, Gustav Wikström, 2015/11/26
- Re: [O] [RFC] [PATCH] Changes to Tag groups - allow nesting and regexps, Nicolas Goaziou, 2015/11/26