From 900fb574eed95b2b384347cbb8d3e8cb3e28fcd5 Mon Sep 17 00:00:00 2001 From: djcb Date: Mon, 24 Jun 2013 22:43:03 +0300 Subject: [PATCH] * mu4e-view.el: fixup display of contacts with control chars --- mu4e/mu4e-view.el | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index a024e213..b3145888 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -312,8 +312,10 @@ at POINT, or if nil, at (point)." (mu4e~view-construct-header field (mapconcat (lambda(c) - (let* ((name (car c)) - (email (cdr c)) + (let* ((name (when (car c) + (replace-regexp-in-string "[[:cntrl:]]" "" (car c)))) + (email (when (cdr c) + (replace-regexp-in-string "[[:cntrl:]]" "" (cdr c)))) (short (or name email)) ;; name may be nil (long (if name (format "%s <%s>" name email) email)) (map (make-sparse-keymap))) @@ -673,11 +675,14 @@ FUNC should be a function taking two arguments: If the message is not New/Unread, do nothing." (when mu4e~view-msg (let ((flags (mu4e-message-field mu4e~view-msg :flags)) + (msgid (mu4e-message-field mu4e~view-msg :message-id)) (docid (mu4e-message-field mu4e~view-msg :docid))) ;; attached (embedded) messages don't have docids; leave them alone ;; is it a new message (when (and docid (or (member 'unread flags) (member 'new flags))) - (mu4e~proc-move docid nil "+S-u-N"))))) + ;; mark /all/ messages with this message-id as read, so all copies of + ;; this message will be marked as read. + (mu4e~proc-move msgid nil "+S-u-N"))))) (defun mu4e~view-fontify-cited () "Colorize message content based on the citation level." @@ -1109,7 +1114,7 @@ list." (mu4e-view-mark-for-unmark) (mu4e-message "Unmarking needs to be done in the header list view"))) - + (defmacro mu4e~view-defun-mark-for (mark) "Define a function mu4e-view-mark-for-MARK." (let ((funcname (intern (format "mu4e-view-mark-for-%s" mark)))