Re: sexp and strings

Subject: Re: sexp and strings

Date: Mon, 13 Jun 2022 15:39:25 -0300

To: erik colson, notmuch@notmuchmail.org

Cc:

From: David Bremner


erik colson <eco@ecocode.net> writes:

> Hi,
>
> I would like to define a squery in my notmuch configuration which would
> ease a query I often use.  The query is
>
>   tag:/ddddd/
>
> where ddddd are decimal numbers.
> Now I would like to shorten this to
>
>   D ddddd
>
> wherefor I was thinking of using a macro like:
>
>   D=(macro (dossier) ((tag (regex ,dossier))))
>
> But this doesn't seem to do the job.
> Any ideas how I can achieve this ?
>

Although you have one too many sets of (), there is still a bug here.

         $ notmuch config set squery.D '(macro (dossier) (tag (regex ,dossier))'

also doesn't work.  Apparently both for regex and wildcard expansion I
did not do macro parameter expansion. In the regex case the regex
matching for tags actually happens at query construction time, so that's
why it ends up as an empty query (presumably none of your tags starts
with ,dossier).

Anyway, I think I know how to fix this, it will mean that in the corner
case of a regex starting with a comma, we'll have to use (regex ",foo").
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: