mu4e/mu-server: use :descending, :no-view parameters

There was some confusion between mu4e and mu-server.
This commit is contained in:
Dirk-Jan C. Binnema 2020-02-17 23:34:45 +02:00
parent c4c56fa7f0
commit 6b07819d9a
2 changed files with 9 additions and 13 deletions

View File

@ -720,7 +720,7 @@ find_handler (Context& context, const Parameters& params)
const auto query{get_string_or(params, "query")}; const auto query{get_string_or(params, "query")};
const auto threads{get_bool_or(params, "threads", false)}; const auto threads{get_bool_or(params, "threads", false)};
const auto sortfieldstr{get_symbol_or(params, "sortfield")}; const auto sortfieldstr{get_symbol_or(params, "sortfield")};
const auto reverse{get_bool_or(params, "reverse", false)}; const auto descending{get_bool_or(params, "descending", false)};
const auto maxnum{get_int_or(params, "maxnum", 500)}; const auto maxnum{get_int_or(params, "maxnum", 500)};
const auto skip_dups{get_bool_or(params, "skip-dups", false)}; const auto skip_dups{get_bool_or(params, "skip-dups", false)};
const auto include_related{get_bool_or(params, "include-related", false)}; const auto include_related{get_bool_or(params, "include-related", false)};
@ -735,7 +735,7 @@ find_handler (Context& context, const Parameters& params)
} }
int qflags{MU_QUERY_FLAG_NONE}; int qflags{MU_QUERY_FLAG_NONE};
if (reverse) if (descending)
qflags |= MU_QUERY_FLAG_DESCENDING; qflags |= MU_QUERY_FLAG_DESCENDING;
if (skip_dups) if (skip_dups)
qflags |= MU_QUERY_FLAG_SKIP_DUPS; qflags |= MU_QUERY_FLAG_SKIP_DUPS;
@ -1151,8 +1151,7 @@ make_command_map (Context& context)
cmap.emplace("compose", cmap.emplace("compose",
CommandInfo{ CommandInfo{
ArgMap{ ArgMap{{"type", ArgInfo{Type::Symbol, true,
{"type", ArgInfo{Type::Symbol, true,
"type of composition: reply/forward/edit/resend/new"}}, "type of composition: reply/forward/edit/resend/new"}},
{"docid", ArgInfo{Type::Integer, false,"document id of parent-message, if any"}}, {"docid", ArgInfo{Type::Integer, false,"document id of parent-message, if any"}},
{"extract-encrypted", ArgInfo{Type::Symbol, false, {"extract-encrypted", ArgInfo{Type::Symbol, false,
@ -1173,8 +1172,7 @@ make_command_map (Context& context)
cmap.emplace("extract", cmap.emplace("extract",
CommandInfo{ CommandInfo{
ArgMap{ ArgMap{{"docid", ArgInfo{Type::Integer, true, "document for the message" }},
{"docid", ArgInfo{Type::Integer, true, "document for the message" }},
{"index", ArgInfo{Type::Integer, true, "index for the part to operate on" }}, {"index", ArgInfo{Type::Integer, true, "index for the part to operate on" }},
{"action", ArgInfo{Type::Symbol, true, "what to do with the part" }}, {"action", ArgInfo{Type::Symbol, true, "what to do with the part" }},
{"extract-encrypted", ArgInfo{Type::Symbol, false, {"extract-encrypted", ArgInfo{Type::Symbol, false,
@ -1191,7 +1189,7 @@ make_command_map (Context& context)
{"threads", ArgInfo{Type::Symbol, false, {"threads", ArgInfo{Type::Symbol, false,
"whether to include threading information" }}, "whether to include threading information" }},
{"sortfield", ArgInfo{Type::Symbol, false, "the field to sort results by" }}, {"sortfield", ArgInfo{Type::Symbol, false, "the field to sort results by" }},
{"sortdir", ArgInfo{Type::Symbol, false, {"descending", ArgInfo{Type::Symbol, false,
"whether to sort in descending order" }}, "whether to sort in descending order" }},
{"maxnum", ArgInfo{Type::Integer, false, {"maxnum", ArgInfo{Type::Integer, false,
"maximum number of result (hint)" }}, "maximum number of result (hint)" }},
@ -1222,8 +1220,7 @@ make_command_map (Context& context)
cmap.emplace("move", cmap.emplace("move",
CommandInfo{ CommandInfo{
ArgMap{ ArgMap{{"docid", ArgInfo{Type::Integer, false, "document-id"}},
{"docid", ArgInfo{Type::Integer, false, "document-id"}},
{"msgid", ArgInfo{Type::String, false, "message-id"}}, {"msgid", ArgInfo{Type::String, false, "message-id"}},
{"flags", ArgInfo{Type::String, false, "new flags for the message"}}, {"flags", ArgInfo{Type::String, false, "new flags for the message"}},
{"maildir", ArgInfo{Type::String, false, "the target maildir" }}, {"maildir", ArgInfo{Type::String, false, "the target maildir" }},
@ -1268,8 +1265,7 @@ make_command_map (Context& context)
cmap.emplace("view", cmap.emplace("view",
CommandInfo{ CommandInfo{
ArgMap{ ArgMap{{"docid", ArgInfo{Type::Integer, false, "document-id"}},
{"docid", ArgInfo{Type::Integer, false, "document-id"}},
{"msgid", ArgInfo{Type::String, false, "message-id"}}, {"msgid", ArgInfo{Type::String, false, "message-id"}},
{"path", ArgInfo{Type::String, false, "message filesystem path"}}, {"path", ArgInfo{Type::String, false, "message filesystem path"}},

View File

@ -381,7 +381,7 @@ or an error."
:query ,query :query ,query
:threads ,threads :threads ,threads
:sortfield ,sortfield :sortfield ,sortfield
:reverse ,(if (eq sortdir 'descending) t nil) :descending ,(if (eq sortdir 'descending) t nil)
:maxnum ,maxnum :maxnum ,maxnum
:skip-dups ,skip-dups :skip-dups ,skip-dups
:include-related ,include-related))) :include-related ,include-related)))
@ -443,7 +443,7 @@ Returns either (:update ... ) or (:error ) sexp, which are handled my
:flags ,(or flags nil) :flags ,(or flags nil)
:maildir ,(or maildir nil) :maildir ,(or maildir nil)
:rename ,(and maildir mu4e-change-filenames-when-moving) :rename ,(and maildir mu4e-change-filenames-when-moving)
:noview ,no-view))) :no-view ,(if no-view t nil))))
(defun mu4e~proc-ping (&optional queries) (defun mu4e~proc-ping (&optional queries)
"Sends a ping to the mu server, expecting a (:pong ...) in response. "Sends a ping to the mu server, expecting a (:pong ...) in response.