aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2018-04-15 19:28:04 +0200
committerNoam Postavsky2018-06-03 12:48:13 -0400
commit4c6cdf6fc9ce8a3309948228995b0ea88704c274 (patch)
treea91c49b71989be1b5abb0bb2fb2b2876a8f69e9d
parent51ee8bc4483d3608f4355777aeabbb31887326d9 (diff)
downloademacs-4c6cdf6fc9ce8a3309948228995b0ea88704c274.tar.gz
emacs-4c6cdf6fc9ce8a3309948228995b0ea88704c274.zip
Revert "Make mail-extract-address-components return the user name more"
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. (cherry picked from commit a3a9d5434d56f8736cc47e379a1d011d4c779b7c)
-rw-r--r--lisp/mail/mail-extr.el39
1 files changed, 19 insertions, 20 deletions
diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el
index 1e18c6d0553..3e8a41fb24c 100644
--- a/lisp/mail/mail-extr.el
+++ b/lisp/mail/mail-extr.el
@@ -1406,26 +1406,25 @@ consing a string.)"
1406 (insert (upcase mi) ". "))) 1406 (insert (upcase mi) ". ")))
1407 1407
1408 ;; Nuke name if it is the same as mailbox name. 1408 ;; Nuke name if it is the same as mailbox name.
1409 (when mail-extr-ignore-single-names 1409 (let ((buffer-length (- (point-max) (point-min)))
1410 (let ((buffer-length (- (point-max) (point-min))) 1410 (i 0)
1411 (i 0) 1411 (names-match-flag t))
1412 (names-match-flag t)) 1412 (when (and (> buffer-length 0)
1413 (when (and (> buffer-length 0) 1413 (eq buffer-length (- mbox-end mbox-beg)))
1414 (eq buffer-length (- mbox-end mbox-beg))) 1414 (goto-char (point-max))
1415 (goto-char (point-max)) 1415 (insert-buffer-substring canonicalization-buffer
1416 (insert-buffer-substring canonicalization-buffer 1416 mbox-beg mbox-end)
1417 mbox-beg mbox-end) 1417 (while (and names-match-flag
1418 (while (and names-match-flag 1418 (< i buffer-length))
1419 (< i buffer-length)) 1419 (or (eq (downcase (char-after (+ i (point-min))))
1420 (or (eq (downcase (char-after (+ i (point-min)))) 1420 (downcase
1421 (downcase 1421 (char-after (+ i buffer-length (point-min)))))
1422 (char-after (+ i buffer-length (point-min))))) 1422 (setq names-match-flag nil))
1423 (setq names-match-flag nil)) 1423 (setq i (1+ i)))
1424 (setq i (1+ i))) 1424 (delete-region (+ (point-min) buffer-length) (point-max))
1425 (delete-region (+ (point-min) buffer-length) (point-max)) 1425 (and names-match-flag
1426 (and names-match-flag 1426 mail-extr-ignore-realname-equals-mailbox-name
1427 mail-extr-ignore-realname-equals-mailbox-name 1427 (narrow-to-region (point) (point)))))
1428 (narrow-to-region (point) (point))))))
1429 1428
1430 ;; Nuke name if it's just one word. 1429 ;; Nuke name if it's just one word.
1431 (goto-char (point-min)) 1430 (goto-char (point-min))