Remove backslashes.
---

Including a new test case.

 emacs/notmuch-show.el |   14 +++++++++-----
 emacs/notmuch-test.el |    6 ++++--
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 02819f3..6b9d1b8 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -248,11 +248,15 @@ unchanged ADDRESS if parsing fails."
        (t
        (setq p-address address)))
       
-      ;; Remove outer double quotes. They might be required during
-      ;; transport, but we don't need to see them.
-      (when (and p-name
-                (string-match "^\"\\(.*\\)\"$" p-name))
-        (setq p-name (match-string 1 p-name)))
+      ;; Remove elements of the mailbox part that are not relevant for
+      ;; display, even if they are required during transport.
+      (when p-name
+       ;; Outer double quotes.
+       (when (string-match "^\"\\(.*\\)\"$" p-name)
+         (setq p-name (match-string 1 p-name)))
+
+       ;; Backslashes.
+       (setq p-name (replace-regexp-in-string "\\\\" "" p-name)))
 
       ;; If the address is '[email protected] <[email protected]>' then show just
       ;; '[email protected]'.
diff --git a/emacs/notmuch-test.el b/emacs/notmuch-test.el
index d6cf318..0637818 100644
--- a/emacs/notmuch-test.el
+++ b/emacs/notmuch-test.el
@@ -74,11 +74,13 @@ the differences, ignoring similarities."
   (let* ((input '("ДБ <[email protected]>"
                  "foo (at home) <[email protected]>"
                  "foo [at home] <[email protected]>"
-                 "Foo Bar"))
+                 "Foo Bar"
+                 "Fred Dibna \\[extraordinaire\\] <[email protected]>"))
         (expected '("ДБ <[email protected]>"
                     "foo (at home) <[email protected]>"
                     "foo [at home] <[email protected]>"
-                    "Foo Bar"))
+                    "Foo Bar"
+                    "Fred Dibna [extraordinaire] <[email protected]>"))
         (output (mapcar #'notmuch-show-clean-address input)))
     (notmuch-test-compare output expected)))
 
-- 
1.7.7.3

_______________________________________________
notmuch mailing list
[email protected]
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to