From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id +BelJ3UcaF8TSAAAsNZ9tg (envelope-from ) for ; Mon, 21 Sep 2020 03:22:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id yE1iI3UcaF8yFAAA1q6Kng (envelope-from ) for ; Mon, 21 Sep 2020 03:22:29 +0000 Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 23288940547 for ; Mon, 21 Sep 2020 03:22:27 +0000 (UTC) Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id D07A27ED33; Sun, 20 Sep 2020 23:22:25 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:date:message-id:mime-version:content-transfer-encoding; s=sasl; bh=M5nI7vdG0ji2gJ9M2My3UIaHyHw=; b=CqtYwNSlgy6cyPxDbWML oQnnZwYHzIcrGn+pvwPsIOf73EfJOPEZdxcK/rzgLfZEiSz8AvQUtm2f9wNTcg5d 2TubSh+faCASxDbYiv5yzT6+DS8k5416fY2Zv1pYGrmK7ERHlK47cY9GlAzSFhpb JU+PDhBZt7KV8Ok46ylmzuk= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id C89897ED32; Sun, 20 Sep 2020 23:22:25 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:subject:date:message-id:mime-version:content-transfer-encoding; s=mesmtp; bh=qwX5s/qAdUs6lX+uXsF+ycxRM/uW3kwu1AWlALhz5Jc=; b=uTy6ZbKf+k+8vOzKLLN6B9zGskCDIzVY87XOZArZXBvNy6iaWZNup52fI5tPnLmt/WcPEIopKSFcjrrU/rVzXqshr8DseB1gglB5NGK6ilzyudFv2rStI1Nxwp2+DcOr1iXBLXW4DDkWwChPoA4EUnNECccsKovWjvZwtqDEo04= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 4CB897ED31; Sun, 20 Sep 2020 23:22:25 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer 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 Message-Id: <20200921032214.16940-1-kyle@kyleam.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Pobox-Relay-ID: AB849E6C-FBB9-11EA-B023-01D9BED8090B-24757444!pb-smtp1.pobox.com Content-Transfer-Encoding: quoted-printable X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=CqtYwNSl; dkim=fail (body hash did not verify) header.d=kyleam.com header.s=mesmtp header.b=uTy6ZbKf; dmarc=none; spf=pass (aspmx1.migadu.com: domain of kyle@kyleam.com designates 64.147.108.70 as permitted sender) smtp.mailfrom=kyle@kyleam.com X-Spam-Score: 2.50 X-TUID: kUfSjHY8hk6G 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. --- 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: =20 (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-nam= e nil)) + (car (mail-extract-address-components from)))) (subject (plist-get info :subject))) (let* ((subnames (split-string sender)) (initials (mapconcat base-commit: 087ed89c30fe96fc7ff1ed13c0895317d180c4d1 --=20 2.28.0