unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Michael J Gruber <michaeljgruber+grubix+git@gmail.com>
To: erik colson <eco@ecocode.net>
Cc: notmuch@notmuchmail.org
Subject: Re: sexp and strings
Date: Mon, 13 Jun 2022 12:11:15 +0200	[thread overview]
Message-ID: <CAA19uiTvp86ygF+p9ONJLc+foQzPnBoqMWoS_gA7Shgkvb0=6Q@mail.gmail.com> (raw)
In-Reply-To: <87k09koqog.fsf@code.pm>

Am Mo., 13. Juni 2022 um 11:31 Uhr schrieb erik colson <eco@ecocode.net>:
>
> Michael J Gruber <michaeljgruber+grubix+git@gmail.com> writes:
>
> > 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 ;)
>
> Thanks for checking this out Michael.  I decided to write an emacs lisp
> function which I keybind and which prompts for the variable, and then
> launches notmuch-search with that:
>
> (defun ec/notmuch-search-dossier ()
>   "Zoek mails van een dossier"
>   (interactive
>    (let* ((dossier (read-no-blanks-input "Dossier:"))
>           (zoek (concat "tag:/" dossier "/")))
>           (notmuch-search zoek nil nil nil nil))))
>
> This works like a charm ;) Well, I am of course open to enhancement
> suggestions!
>
> Also I upgraded my OS to fedora36 and now I use the standard notmuch
> package instead of compiling it myself.  So I don't have sexp support
> anymore and therefor I am moving the squeries I added to my notmuch
> config into emacs lisp functions.

FYI: I submitted sfsexp to fedora (review pending), and as soon as
that is in, I will adjust the notmuch package.
(Until then there is copr mjg/notmuch-sfsexp at your own risk ;))

Cheers
Michael

  reply	other threads:[~2022-06-13 10:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-12 23:11 sexp and strings erik colson
2022-06-13  9:12 ` Michael J Gruber
2022-06-13  9:31   ` erik colson
2022-06-13 10:11     ` Michael J Gruber [this message]
2022-06-13 15:10       ` erik colson
2022-06-13 18:39 ` David Bremner
2022-06-14 11:22   ` [PATCH 1/2] test/sexp: add known broken tests for macro param inside rx/wildcard David Bremner
2022-06-14 11:22     ` [PATCH 2/2] lib/sexp: add parameter expansion for regex and wildcard David Bremner
2022-07-01 11:41   ` sexp and strings David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAA19uiTvp86ygF+p9ONJLc+foQzPnBoqMWoS_gA7Shgkvb0=6Q@mail.gmail.com' \
    --to=michaeljgruber+grubix+git@gmail.com \
    --cc=eco@ecocode.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).