Am Mo., 13. Juni 2022 um 01:20 Uhr schrieb erik colson <[email protected]>:
>
> 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 ?

That search works without the macro, but not as a macro: notmuch
computes an empty `Query()` for this (as per `NOTMUCH_DEBUG_QUERY=1`).
I'm not sure whether this is intended or an artefact of the
implementation, since both the macro and the regex need
expansion/evaluation before being fed to xapian, and the order
matters.

Defining `D=(macro (dossier) ((tag ,dossier)))` and calling it with
`(D (rx ddddd))` works, btw (but is not what you want, obviously), so
something tells me lazy evaluation of macros is not completely lazy ;)

Michael
_______________________________________________
notmuch mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to