summaryrefslogtreecommitdiff
path: root/mu4e
diff options
context:
space:
mode:
authorDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2019-09-26 00:34:30 +0300
committerDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2019-09-26 00:35:23 +0300
commit30865c9d2ccf85a68a3a6ff51d0087e3d182d6a2 (patch)
tree5d7816a808af03b6f1cba1ad1a02b1eb08a26f74 /mu4e
parent9457f2f591780ee7afe5cd1421d0b45b6c512f53 (diff)
mu4e: add mu4e-contacts-info
Add an interactive function mu4e-contacts-info, to display some information about the contacts cache.
Diffstat (limited to 'mu4e')
-rw-r--r--mu4e/mu4e-utils.el22
1 files changed, 21 insertions, 1 deletions
diff --git a/mu4e/mu4e-utils.el b/mu4e/mu4e-utils.el
index 7a8271b..0681dcf 100644
--- a/mu4e/mu4e-utils.el
+++ b/mu4e/mu4e-utils.el
@@ -685,7 +685,7 @@ process."
"Timestamp for the most recent contacts update." )
(defun mu4e~update-contacts (contacts &optional tstamp)
- "Rceive a sorted list of CONTACTS.
+ "Receive a sorted list of CONTACTS.
Each of the contacts has the form
(FULL_EMAIL_ADDRESS . RANK) and fill the hash
`mu4e~contacts' with it, with each contact mapped to an integer
@@ -713,6 +713,26 @@ This is used by the completion function in mu4e-compose."
(mu4e-index-message "Contacts updated: %d; total %d"
n (hash-table-count mu4e~contacts))))
+(defun mu4e-contacts-info ()
+ "Display information about the cache used for contacts
+completion; for testing/debugging."
+ (interactive)
+ (with-current-buffer (get-buffer-create "*mu4e-contacts-info*")
+ (erase-buffer)
+ (insert (format "complete addresses: %s\n"
+ (if mu4e-compose-complete-addresses "yes" "no")))
+ (insert (format "only personal addresses: %s\n"
+ (if mu4e-compose-complete-only-personal "yes" "no")))
+ (insert (format "only addresses seen after: %s\n"
+ (or mu4e-compose-complete-only-after "no restrictions")))
+
+ (when mu4e~contacts
+ (insert (format "number of contacts cached: %d\n\n"
+ (hash-table-count mu4e~contacts)))
+ (maphash (lambda(key val)
+ (insert (format "%S\n" key))) mu4e~contacts)))
+ (pop-to-buffer "*mu4e-contacts-info*"))
+
(defun mu4e~check-requirements ()
"Check for the settings required for running mu4e."
(unless (>= emacs-major-version 23)