From e1201395d3aaecc00f15d5b354da72ff0ce4ce7e Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 20 Sep 2020 23:22:14 -0400 Subject: piem-name-branch-who-what-v: Relax sender name extraction Let-bind mail-extr-ignore-realname-equals-mailbox-name to nil (defaults to t) so that a sender name is returned for addresses like "name " and "name@a.com". Also, let-bind mail-extr-ignore-single-names to its default value of nil so that a user setting this option to t doesn't interfere with piem-name-branch-who-what-v. Message-Id: <20200921032214.16940-1-kyle@kyleam.com> --- piem.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/piem.el b/piem.el index 6ec757d..eb7b2f8 100644 --- a/piem.el +++ b/piem.el @@ -38,6 +38,7 @@ ;;; Code: (require 'cl-lib) +(require 'mail-extr) (require 'message) (require 'piem-maildir) (require 'rfc2047) @@ -611,7 +612,9 @@ indicated in the subject. INFO is a plist with properties documented in `piem-default-branch-function'." (when-let ((from (plist-get info :from)) - (sender (car (mail-extract-address-components from))) + (sender (let ((mail-extr-ignore-single-names nil) + (mail-extr-ignore-realname-equals-mailbox-name nil)) + (car (mail-extract-address-components from)))) (subject (plist-get info :subject))) (let* ((subnames (split-string sender)) (initials (mapconcat -- cgit v1.2.3