* mu4e: support setting my-addresses when indexing

This commit is contained in:
djcb
2012-06-19 17:59:35 +03:00
parent 39ff643e48
commit b150f45090
5 changed files with 49 additions and 19 deletions

View File

@ -371,10 +371,18 @@ or (:error ) sexp, which are handled my `mu4e-update-func' and
idparam (or flagstr "") (or path ""))))
(defun mu4e~proc-index (path)
(defun mu4e~proc-index (path my-addresses)
"Update the message database for filesystem PATH, which should
point to some maildir directory structure."
(mu4e~proc-send-command "index path:\"%s\"" path))
point to some maildir directory structure. MY-ADDRESSES is a
list of my email addresses (see e.g. `mu4e-my-email-addresses')."
(let ((addrs
(when my-addresses
(mapconcat 'identity my-addresses ","))))
(if addrs
(mu4e~proc-send-command "index path:\"%s\" my-addresses:%s"
path addrs)
(mu4e~proc-send-command "index path:\"%s\"" path))))
(defun mu4e~proc-add (path maildir)
"Add the message at PATH to the database, with MAILDIR set to the
@ -448,7 +456,6 @@ contacts seen after NEWER-THAN (the time_t value)."
(if only-personal "true" "false")
(if newer-than newer-than 0)))
(defun mu4e~proc-view (docid-or-msgid &optional images)
"Get one particular message based on its DOCID-OR-MSGID (keyword
argument). Optionally, if IMAGES is non-nil, backend will any

View File

@ -677,10 +677,9 @@ processing takes part in the background, unless buf is non-nil."
(message nil)
;; there may be an error, give the user up to 5 seconds to check
(when maybe-error
(sit-for 5))
(mu4e~proc-index mu4e-maildir)
(let ((buf (process-buffer proc)))
(when (buffer-live-p buf)
(sit-for 5))
(mu4e~proc-index mu4e-maildir mu4e-my-email-addresses)
(when (buffer-live-p buf)
(kill-buffer buf)))))))

View File

@ -75,10 +75,20 @@ mu4e."
:group 'mu4e
:safe 'stringp)
(defvar mu4e-user-mail-address-regexp "$^"
(defcustom mu4e-user-mail-address-regexp "$^"
"Regular expression matching the user's mail address(es). This is
used to distinguish ourselves from others, e.g. when replying and
in :from-or-to headers. By default, match nothing.")
in :from-or-to headers. By default, match nothing."
:type 'string
:group 'mu4e
:safe 'stringp)
(defcustom mu4e-my-email-addresses `(,user-mail-address)
"List of e-mail addresses to consider 'my email addresses',
ie. addresses whose presence in an email imply that it is a
personal message. This is used when indexing messages."
:type '(string)
:group 'mu4e)
(defvar mu4e-date-format-long "%c"
"Date format to use in the message view, in the format of
@ -139,12 +149,6 @@ restriction."
:type 'integer
:group 'mu4e-compose)
(defcustom mu4e-compose-my-email-addresses `(,user-mail-address)
"List of e-mail addresses to consider 'my email addresses',
ie. addresses whose presence in an email imply that it is a
personal message."
:type '(string)
:group 'mu4e-compose)
;; Folders
(defgroup mu4e-folders nil