Re: sexp and strings

Subject: Re: sexp and strings

Date: Mon, 13 Jun 2022 11:31:27 +0200

To: Michael J Gruber

Cc: notmuch@notmuchmail.org

From: erik colson


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.

best
-- 
erik colson
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: