emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 8b50ae8: Make mail-extract-address-components retur


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 8b50ae8: Make mail-extract-address-components return the user name more
Date: Mon, 08 Feb 2016 05:48:20 +0000

branch: master
commit 8b50ae8b2284b5652c2843a9d0d076f4f657be28
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Make mail-extract-address-components return the user name more
    
    * lisp/mail/mail-extr.el (mail-extract-address-components):
    Return the name even if it's the same as the mailbox name (if
    `mail-extr-ignore-single-names' isn't set) (bug#22594).
---
 lisp/mail/mail-extr.el |   39 ++++++++++++++++++++-------------------
 1 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el
index 6384967..9dc3af6 100644
--- a/lisp/mail/mail-extr.el
+++ b/lisp/mail/mail-extr.el
@@ -1406,25 +1406,26 @@ consing a string.)"
              (insert (upcase mi) ". ")))
 
          ;; Nuke name if it is the same as mailbox name.
-         (let ((buffer-length (- (point-max) (point-min)))
-               (i 0)
-               (names-match-flag t))
-           (when (and (> buffer-length 0)
-                      (eq buffer-length (- mbox-end mbox-beg)))
-             (goto-char (point-max))
-             (insert-buffer-substring canonicalization-buffer
-                                      mbox-beg mbox-end)
-             (while (and names-match-flag
-                         (< i buffer-length))
-               (or (eq (downcase (char-after (+ i (point-min))))
-                       (downcase
-                        (char-after (+ i buffer-length (point-min)))))
-                   (setq names-match-flag nil))
-               (setq i (1+ i)))
-             (delete-region (+ (point-min) buffer-length) (point-max))
-             (and names-match-flag
-                          mail-extr-ignore-realname-equals-mailbox-name
-                          (narrow-to-region (point) (point)))))
+          (when mail-extr-ignore-single-names
+            (let ((buffer-length (- (point-max) (point-min)))
+                  (i 0)
+                  (names-match-flag t))
+              (when (and (> buffer-length 0)
+                         (eq buffer-length (- mbox-end mbox-beg)))
+                (goto-char (point-max))
+                (insert-buffer-substring canonicalization-buffer
+                                         mbox-beg mbox-end)
+                (while (and names-match-flag
+                            (< i buffer-length))
+                  (or (eq (downcase (char-after (+ i (point-min))))
+                          (downcase
+                           (char-after (+ i buffer-length (point-min)))))
+                      (setq names-match-flag nil))
+                  (setq i (1+ i)))
+                (delete-region (+ (point-min) buffer-length) (point-max))
+                (and names-match-flag
+                     mail-extr-ignore-realname-equals-mailbox-name
+                     (narrow-to-region (point) (point))))))
 
          ;; Nuke name if it's just one word.
          (goto-char (point-min))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]