diff options
| author | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2025-01-05 22:41:24 +0200 |
|---|---|---|
| committer | Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> | 2025-01-08 22:12:47 +0200 |
| commit | 5f8e0b71f091836c07be67e40402c3dbd8389ba7 (patch) | |
| tree | 72dc309ea3806170319a40d58f94e43b40bd2b53 /lib | |
| parent | b3891600663c7d00a92eb429845af63e8305306a (diff) | |
server: make parsed queries available to mu4e
Basically, make the "mu find .... --analyze" information available in
mu4e, through a function mu4e-server-last-query.
This is shows the query as the server saw it, as well as the parse
s-expressions. This can be useful to see how some query is interpreted.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/mu-server.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/mu-server.cc b/lib/mu-server.cc index 6048b70..4862f7a 100644 --- a/lib/mu-server.cc +++ b/lib/mu-server.cc @@ -1,5 +1,5 @@ /* -** Copyright (C) 2020-2023 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> +** Copyright (C) 2020-2025 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl> ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -39,6 +39,7 @@ #include "mu-maildir.hh" #include "mu-query.hh" +#include "mu-query-parser.hh" #include "mu-store.hh" #include "utils/mu-utils.hh" @@ -703,7 +704,12 @@ Server::Private::find_handler(const Command& cmd) output_sexp(Sexp().put_props(":erase", Sexp::t_sym)); const auto bsize{static_cast<size_t>(batch_size)}; const auto foundnum = output_results(*qres, bsize); - output_sexp(Sexp().put_props(":found", foundnum)); + + output_sexp(Sexp().put_props( + ":found", foundnum, + ":query", q, + ":query-sexp", parse_query(q, false/*!expand*/).to_string(), + ":query-sexp-expanded", parse_query(q, true/*expand*/).to_string())); } void |
