* add skipping-dups support to mu4e

This commit is contained in:
djcb
2012-12-17 22:30:26 +02:00
parent 3353e32c28
commit 7053582dd7
3 changed files with 33 additions and 25 deletions

View File

@ -317,25 +317,29 @@ In particular, backslashes and double-quotes."
(let ((esc (replace-regexp-in-string "\\\\" "\\\\\\\\" query)))
(replace-regexp-in-string "\"" "\\\\\"" esc)))
(defun mu4e~proc-find (query threads sortfield sortdir maxnum)
(defun mu4e~proc-find (query threads sortfield sortdir maxnum skip-dups)
"Start a database query for QUERY.
If THREADS is non-nil, show results in threaded fasion, SORTFIELD
is a symbol describing the field to sort by (or nil); see
`mu4e~headers-sortfield-choices'. If SORT is `descending', sort
Z->A, if it's `ascending', sort A->Z. MAXNUM determines the maximum
number of results to return, or nil for 'unlimited'. For each
number of results to return, or nil for 'unlimited'. If
SKIP-DUPS is non-nil, show only one of duplicate messages.
For each
result found, a function is called, depending on the kind of
result. The variables `mu4e-error-func' contain the function that
will be called for, resp., a message (header row) or an error."
(mu4e~proc-send-command
"find query:\"%s\" threads:%s sortfield:%s reverse:%s maxnum:%d"
"find query:\"%s\" threads:%s sortfield:%s reverse:%s maxnum:%d skip-dups:%s"
(mu4e~proc-escape-query query)
(if threads "true" "false")
;; sortfield is e.g. ':subject'; this removes the ':'
(if (null sortfield) "nil" (substring (symbol-name sortfield) 1))
;; TODO: use ascending/descending in backend too (it's clearer than 'reverse'
(if (eq sortdir 'descending) "true" "false")
(if maxnum maxnum -1)))
(if maxnum maxnum -1)
(if skip-dups "true" "false")))
(defun mu4e~proc-move (docid-or-msgid &optional maildir flags)
"Move message identified by DOCID-OR-MSGID.