diff options
| author | Lars Ingebrigtsen | 2016-02-08 16:44:56 +1100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-08 16:44:56 +1100 |
| commit | 8b50ae8b2284b5652c2843a9d0d076f4f657be28 (patch) | |
| tree | d56ac88709a06030288350bef0b6e9b0e05cd22d | |
| parent | 94d9396a4b6d6b4870127f9dabb4d454ea50a9c1 (diff) | |
| download | emacs-8b50ae8b2284b5652c2843a9d0d076f4f657be28.tar.gz emacs-8b50ae8b2284b5652c2843a9d0d076f4f657be28.zip | |
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).
| -rw-r--r-- | 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 63849679e70..9dc3af6ab65 100644 --- a/lisp/mail/mail-extr.el +++ b/lisp/mail/mail-extr.el | |||
| @@ -1406,25 +1406,26 @@ 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 | (let ((buffer-length (- (point-max) (point-min))) | 1409 | (when mail-extr-ignore-single-names |
| 1410 | (i 0) | 1410 | (let ((buffer-length (- (point-max) (point-min))) |
| 1411 | (names-match-flag t)) | 1411 | (i 0) |
| 1412 | (when (and (> buffer-length 0) | 1412 | (names-match-flag t)) |
| 1413 | (eq buffer-length (- mbox-end mbox-beg))) | 1413 | (when (and (> buffer-length 0) |
| 1414 | (goto-char (point-max)) | 1414 | (eq buffer-length (- mbox-end mbox-beg))) |
| 1415 | (insert-buffer-substring canonicalization-buffer | 1415 | (goto-char (point-max)) |
| 1416 | mbox-beg mbox-end) | 1416 | (insert-buffer-substring canonicalization-buffer |
| 1417 | (while (and names-match-flag | 1417 | mbox-beg mbox-end) |
| 1418 | (< i buffer-length)) | 1418 | (while (and names-match-flag |
| 1419 | (or (eq (downcase (char-after (+ i (point-min)))) | 1419 | (< i buffer-length)) |
| 1420 | (downcase | 1420 | (or (eq (downcase (char-after (+ i (point-min)))) |
| 1421 | (char-after (+ i buffer-length (point-min))))) | 1421 | (downcase |
| 1422 | (setq names-match-flag nil)) | 1422 | (char-after (+ i buffer-length (point-min))))) |
| 1423 | (setq i (1+ i))) | 1423 | (setq names-match-flag nil)) |
| 1424 | (delete-region (+ (point-min) buffer-length) (point-max)) | 1424 | (setq i (1+ i))) |
| 1425 | (and names-match-flag | 1425 | (delete-region (+ (point-min) buffer-length) (point-max)) |
| 1426 | mail-extr-ignore-realname-equals-mailbox-name | 1426 | (and names-match-flag |
| 1427 | (narrow-to-region (point) (point))))) | 1427 | mail-extr-ignore-realname-equals-mailbox-name |
| 1428 | (narrow-to-region (point) (point)))))) | ||
| 1428 | 1429 | ||
| 1429 | ;; Nuke name if it's just one word. | 1430 | ;; Nuke name if it's just one word. |
| 1430 | (goto-char (point-min)) | 1431 | (goto-char (point-min)) |