]> git.eshelyaron.com Git - emacs.git/commitdiff
Revert "Make mail-extract-address-components return the user name more"
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 15 Apr 2018 17:28:04 +0000 (19:28 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 15 Apr 2018 17:28:04 +0000 (19:28 +0200)
This reverts commit 8b50ae8b2284b5652c2843a9d0d076f4f657be28.

According to tests in bug#27656 by OGAWA Hirofumi, this patch
led to wrong results when binding

(dolist (addr '("Rasmus <rasmus@gmx.us>" "Rasmus <mbox@gmx.us>"))
  (dolist (ignore-single '(t nil))
    (dolist (ignore-same '(t nil))
      (let ((mail-extr-ignore-single-names ignore-single)
    (mail-extr-ignore-realname-equals-mailbox-name ignore-same))
(message "%s" (mail-extract-address-components addr))))))

in combination.

lisp/mail/mail-extr.el

index 1e18c6d0553282341df141e6cabc7e55ec23e69d..3e8a41fb24c5b966dd2fdcd4060799b2286c3817 100644 (file)
@@ -1406,26 +1406,25 @@ consing a string.)"
              (insert (upcase mi) ". ")))
 
          ;; Nuke name if it is the same as mailbox name.
-          (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))))))
+         (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))