mu4e: implement mu4e-compose-complete-only-after

We weren't supporting that yet after moving to the new command-parser;
let's do so now.

We now pass the time_t as a string, since the parser does not support
floats (and emacs doesn't generally support big ints).
This commit is contained in:
Dirk-Jan C. Binnema 2020-01-25 19:32:07 +02:00
parent 0f81c86083
commit eb3cac39ee
3 changed files with 10 additions and 9 deletions

View File

@ -483,7 +483,7 @@ AFTER is non-nil, get only contacts seen AFTER (the time_t
value)."
(mu4e~call-mu `(contacts
:personal ,personal
;; :after ,(or after nil)
:after ,(or after nil)
:tstamp ,(or tstamp nil))))
(defun mu4e~proc-view (docid-or-msgid &optional images decrypt)

View File

@ -780,11 +780,8 @@ nothing."
(setq mu4e-contacts-func 'mu4e~update-contacts)
(mu4e~proc-contacts
mu4e-compose-complete-only-personal
(when mu4e-compose-complete-only-after
(float-time
(apply 'encode-time
(mu4e-parse-time-string mu4e-compose-complete-only-after))))
mu4e~contacts-tstamp)))
mu4e-compose-complete-only-after
mu4e~contacts-tstamp)))
(defun mu4e~pong-handler (props func)
"Handle 'pong' responses from the mu server."

View File

@ -370,9 +370,13 @@ addresses)."
(defcustom mu4e-compose-complete-only-after "2014-01-01"
"Consider only contacts last seen after this date.
Date must be a string, in a format parseable by
`org-parse-time-string'. This excludes really old contacts.
Set to nil to not have any time-based restriction."
Date must be a string of the form YYY-MM-DD.
This is useful for limiting a potentially enormous set of
contacts for auto-completion to just those that are present in
the e-mail corpus in recent timses. Set to nil to not have any
time-based restriction."
:type 'string
:group 'mu4e-compose)