From: Kyle Meyer <kyle@kyleam.com>
To: piem@inbox.kyleam.com
Subject: [PATCH] piem-name-branch-who-what-v: Relax sender name extraction
Date: Sun, 20 Sep 2020 23:22:14 -0400 [thread overview]
Message-ID: <20200921032214.16940-1-kyle@kyleam.com> (raw)
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 <name@a.com>" 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.
---
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 @@ (defun piem-name-branch-who-what-v (info)
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
base-commit: 087ed89c30fe96fc7ff1ed13c0895317d180c4d1
--
2.28.0
reply other threads:[~2020-09-21 3:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://git.kyleam.com/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200921032214.16940-1-kyle@kyleam.com \
--to=kyle@kyleam.com \
--cc=piem@inbox.kyleam.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.kyleam.com/piem/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).