discussion and development of piem
 help / color / mirror / code / Atom feed
* [PATCH] piem-name-branch-who-what-v: Relax sender name extraction
@ 2020-09-21  3:22 Kyle Meyer
  0 siblings, 0 replies; only message in thread
From: Kyle Meyer @ 2020-09-21  3:22 UTC (permalink / raw)
  To: piem

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-21  3:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-21  3:22 [PATCH] piem-name-branch-who-what-v: Relax sender name extraction Kyle Meyer

Code repositories for project(s) associated with this 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).