(with-eval-after-load 'notmuch (defun my-notmuch-query (sexp) "Return string query equivalent to SEXP." (format "sexp:\"%s\"" (string-replace "\"" "\"\"" (format "%S" sexp)))))
(with-eval-after-load 'notmuch (unless (equal (notmuch-config-get "built_with.sexp_queries") "true") (user-error "Notmuch not built with sexps.")))