summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2020-04-06 20:49:39 +0300
committerDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2020-04-06 20:52:24 +0300
commitabafd658d49f0849b83d3c3fa51625a236c4c7a7 (patch)
treed30c2af862eea91abc47a1fb3f2f11ad1477ce88
parentedd47ced712f14feb889dafe4428391dde917b56 (diff)
mu4e: show mu4e-personal-addresses, add check
Show the personal addresses in the main screen (allow hiding them with mu4e-main-view-hide-addresses), as well as a check for the case where user's user-email-address is not part of the personal addresses.
-rw-r--r--NEWS.org13
-rw-r--r--mu4e/mu4e-main.el23
2 files changed, 28 insertions, 8 deletions
diff --git a/NEWS.org b/NEWS.org
index 78c6b07..5e9d937 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -7,7 +7,8 @@
- There's a new subcommand ~mu init~ to initialize the mu database, which
takes the ~--maildir~ and ~--my-address~ parameters that ~index~ used to take.
- These parameters are persistent so ~index~ does not need them anymore.
+ These parameters are persistent so ~index~ does not need (or accept) them
+ anymore. ~mu4e~ now depends on those parameters.
~init~ only needs to be run once or when changing these parameters. That
implies that you need to re-index after changing these parameters.
@@ -25,8 +26,9 @@
passing ~--muhome=~/.mu~ to various ~mu~ commands, or setting ~(setq
mu4e-mu-home "~/.mu")~ for ~mu4e~.
- It is expected that the directory where the database lives survives a
- reboot; if that is not true for the default, you can use ~--muhome~.
+ It is expected that the directory where the database lives, survives a
+ reboot; if that is not true in your case, you can use ~--muhome~ (otherwise
+ you'd have to reindex after each reboot).
After upgrading, you may wish to delete the files in the old location to
recover some diskspace.
@@ -43,6 +45,11 @@
It is strongly recommended that you run ~mu init~ with the appropriate
parameters to (re)initialize the Xapian database.
+ The main screen shows your address(es), and issues a warning if
+ ~user-email-address~ is not part of that (and refer you to ~mu init~). You can
+ avoid the addresses in the main screen and the warning by setting
+ ~mu4e-main-view-hide-addresses~ to non-nil.
+
- In many cases, ~mu4e~ used to receive /all/ contacts after each indexing
operation; this was slow for some users, so we have updated this to /only/
get the contacts that have changed since the last round.
diff --git a/mu4e/mu4e-main.el b/mu4e/mu4e-main.el
index d0ce450..43627a3 100644
--- a/mu4e/mu4e-main.el
+++ b/mu4e/mu4e-main.el
@@ -32,6 +32,13 @@
;;; Mode
+(defvar mu4e-main-buffer-hide-personal-addresses nil
+ "Whether to hid trhe personal address in the main view. This
+ can be useful to avoid the noise when there are many.
+
+ This also hides the warning if your `user-mail-address' is not
+part of the personal addresses.")
+
(defvar mu4e-main-buffer-name " *mu4e-main*"
"Name of the mu4e main view buffer. The default name starts
with SPC and therefore is not visible in buffer list.")
@@ -171,7 +178,8 @@ When REFRESH is non nil refresh infos from server."
(defun mu4e~main-redraw-buffer ()
(with-current-buffer mu4e-main-buffer-name
(let ((inhibit-read-only t)
- (pos (point)))
+ (pos (point))
+ (addrs (mu4e-personal-addresses)))
(erase-buffer)
(insert
"* "
@@ -213,10 +221,15 @@ When REFRESH is non nil refresh infos from server."
(mu4e~key-val "maildir" (mu4e-root-maildir))
(mu4e~key-val "in store"
(format "%d" (plist-get mu4e~server-props :doccount)) "messages")
- ;; (mu4e~key-val "personal addresses"
- ;; (let ((addrs (mu4e-personal-addresses)))
- ;; (if addrs(string-join addrs ", " ) "none")))
- )
+ (unless mu4e-main-buffer-hide-personal-addresses
+ (mu4e~key-val "personal addresses" (if addrs (string-join addrs ", " ) "none"))))
+
+ (unless mu4e-main-buffer-hide-personal-addresses
+ (when (and addrs user-mail-address (not (member user-mail-address addrs)))
+ (mu4e-message (concat
+ "Note: `user-mail-address' ('%s') is not part "
+ "of mu's addresses; add it with 'mu init --my-address='")
+ user-mail-address)))
(mu4e-main-mode)
(goto-char pos))))