From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6PMwGzhxa1/wPQAA0tVLHw (envelope-from ) for ; Wed, 23 Sep 2020 16:00:56 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id uIYdFzhxa187XAAAbx9fmQ (envelope-from ) for ; Wed, 23 Sep 2020 16:00:56 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9F6949402A5 for ; Wed, 23 Sep 2020 16:00:54 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 5A6A629BDA; Wed, 23 Sep 2020 12:00:45 -0400 (EDT) Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) by mail.notmuchmail.org (Postfix) with ESMTPS id 7E5D22930F for ; Wed, 23 Sep 2020 12:00:42 -0400 (EDT) Received: from bell.riseup.net (bell-pn.riseup.net [10.0.1.178]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4BxNF53bR0zFf2P for ; Wed, 23 Sep 2020 09:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1600876841; bh=es68vnRB188p3EdcyVz1iLlLfairJJAdL+8mTy+l52I=; h=From:To:Subject:Date:From; b=pwf11KDAytrCKKeiFuIPtEEdIeTi3v988bFpsJvtoncoqisWoSe3wsDef8hP0Z5n7 uhbx539QIAzCftIKitbeusijTlqMGiup4/zLabCvyMkEtPhY7foZVcxY+Q3Jn7i4XD qepKaqXd/NfQQPNxJR6bbhfA0L2ijqyMiD0yFm/c= X-Riseup-User-ID: 503EBD490D1057E7F97F2EC14FB183776E87D339FEA34DE534C202E79D48845C Received: from [127.0.0.1] (localhost [127.0.0.1]) by bell.riseup.net (Postfix) with ESMTPSA id 4BxNF44vnFzJnQY for ; Wed, 23 Sep 2020 09:00:40 -0700 (PDT) From: George Kadianakis To: notmuch@notmuchmail.org Subject: emacs: How to tab-complete destination email addresses? Date: Wed, 23 Sep 2020 19:00:37 +0300 Message-ID: <87h7roa3fe.fsf@riseup.net> MIME-Version: 1.0 Message-ID-Hash: 2I7RHYYXHLOSXDTW4MEC5YPJ7TCZGPJL X-Message-ID-Hash: 2I7RHYYXHLOSXDTW4MEC5YPJ7TCZGPJL X-MailFrom: desnacked@riseup.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=riseup.net header.s=squak header.b=pwf11KDA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 1.13 X-TUID: SugBQLIxZ8oy Hello list, when I write an email with notmuch on emacs, I use tab-completion to auto-complete email addresses. It's just impossible to remember all the email addresses. The problem is that, while doing that and over the past few months, I've sent many emails to obsolete email addresses that people have stopped using for like 8 years now, just because that email address was in my inbox somewhere. This is bad because people never receive those emails. It seems to me that the ab-completion logic of emacs-notmuch is naive and does no effort to actually find a useful email address for the person in question. How are you all handling this problem? It seems like the interesting function here is `notmuch-address-expand-name`, which calls notmuch-address(1). So far so good. However notmuch-address seems to be simple and Unixy enough that we can't expect it to do fun heuristics like choosing the best email address that should be used in each occasion. Furthermore, I can't tell notmuch-address which addresses it uses wrong and teach it to use the right ones. So what to do? One way forward is to switch from using notmuch-address to using something like bbdb and manually curate my database (since bbdb offers this capability). But I think the right way would be to somehow introduce a bunch of heuristics in notmuch/emacs so that the right email address is chosen for each person. For example, if I tab-complete "Alice", I would like notmuch to give me the email address that Alice has used herself most frequently the past few times she contacted me. Perhaps there is something that does what I want already? If that's the case, I'd love to be pointed to a good solution! Thanks for all your work on notmuch!:)