unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* emacs: How to tab-complete destination email addresses?
@ 2020-09-23 16:00 George Kadianakis
  2020-09-23 16:20 ` Jameson Graef Rollins
  2020-09-29 19:46 ` Alexander Adolf
  0 siblings, 2 replies; 6+ messages in thread
From: George Kadianakis @ 2020-09-23 16:00 UTC (permalink / raw)
  To: notmuch

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!:)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: emacs: How to tab-complete destination email addresses?
  2020-09-23 16:00 emacs: How to tab-complete destination email addresses? George Kadianakis
@ 2020-09-23 16:20 ` Jameson Graef Rollins
  2020-09-24 17:03   ` George Kadianakis
  2020-09-29 19:46 ` Alexander Adolf
  1 sibling, 1 reply; 6+ messages in thread
From: Jameson Graef Rollins @ 2020-09-23 16:20 UTC (permalink / raw)
  To: George Kadianakis, notmuch

On Wed, Sep 23 2020, George Kadianakis <desnacked@riseup.net> wrote:
> 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!

I find the convenience of not having to maintain an address book to be a
huge win with the use of notmuch-address, so I'm generally fine to
filter through the offered addresses to find the one that I generally
recognize to be the most viable.  That said, an obvious improvement (as
you suggest) would be to order addresses based on most recent+frequent
use, so that the most recently used one shows up first.

The problem I have, though, is that for some reason that I don't
understand the interface can use To: address, or From: addresses, but
not both.  This is by far the most annoying thing to me, since in both
scenarios there will end up being missing addresses that I need that I
then have to go search for manually.  If the interface could be
configured to return most From: and To: address that would be a big
improvement imho.

jamie.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: emacs: How to tab-complete destination email addresses?
  2020-09-23 16:20 ` Jameson Graef Rollins
@ 2020-09-24 17:03   ` George Kadianakis
  2020-09-24 17:47     ` David Bremner
  0 siblings, 1 reply; 6+ messages in thread
From: George Kadianakis @ 2020-09-24 17:03 UTC (permalink / raw)
  To: Jameson Graef Rollins, notmuch

Jameson Graef Rollins <jrollins@finestructure.net> writes:

> On Wed, Sep 23 2020, George Kadianakis <desnacked@riseup.net> wrote:
>> 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 the response Jameson!

> I find the convenience of not having to maintain an address book to be a
> huge win with the use of notmuch-address, so I'm generally fine to
> filter through the offered addresses to find the one that I generally
> recognize to be the most viable.  That said, an obvious improvement (as
> you suggest) would be to order addresses based on most recent+frequent
> use, so that the most recently used one shows up first.
>

So I guess this ordering should happen internally in notmuch-address,
right? Perhaps as a new type of "--sort" option like "--most-frequent"
or "--best-fit".

If this is the right way to do it, perhaps I'll take a stab at it over
the next days. If it's not the right way to do it, please let me know so
that I don't do useless things! :)

> The problem I have, though, is that for some reason that I don't
> understand the interface can use To: address, or From: addresses, but
> not both.  This is by far the most annoying thing to me, since in both
> scenarios there will end up being missing addresses that I need that I
> then have to go search for manually.  If the interface could be
> configured to return most From: and To: address that would be a big
> improvement imho.
>

Hmm, I've never used this interface but if you are talking about the
"--output" switch I see that they can be combined. So like you can do:

           $ notmuch address --output sender --output recipients jameson 

to combine both To: and From:.

Best of luck!

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: emacs: How to tab-complete destination email addresses?
  2020-09-24 17:03   ` George Kadianakis
@ 2020-09-24 17:47     ` David Bremner
  2020-09-24 20:09       ` Jameson Graef Rollins
  0 siblings, 1 reply; 6+ messages in thread
From: David Bremner @ 2020-09-24 17:47 UTC (permalink / raw)
  To: George Kadianakis, Jameson Graef Rollins, notmuch

George Kadianakis <desnacked@riseup.net> writes:

>
> So I guess this ordering should happen internally in notmuch-address,
> right? Perhaps as a new type of "--sort" option like "--most-frequent"
> or "--best-fit".
>
> If this is the right way to do it, perhaps I'll take a stab at it over
> the next days. If it's not the right way to do it, please let me know so
> that I don't do useless things! :)
>

there was some discussion about upstreaming some of the features of
notmuch-addrlookup-c into notmuch-address [1]. I'm not sure what
happened there, but maybe this helps.

>
> Hmm, I've never used this interface but if you are talking about the
> "--output" switch I see that they can be combined. So like you can do:
>
>            $ notmuch address --output sender --output recipients jameson 
>
> to combine both To: and From:.

Maybe the elisp 'internal' front-end needs to be updated to (optionally) do what
Jamie asks.

[1]: https://github.com/aperezdc/notmuch-addrlookup-c/issues/23

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: emacs: How to tab-complete destination email addresses?
  2020-09-24 17:47     ` David Bremner
@ 2020-09-24 20:09       ` Jameson Graef Rollins
  0 siblings, 0 replies; 6+ messages in thread
From: Jameson Graef Rollins @ 2020-09-24 20:09 UTC (permalink / raw)
  To: David Bremner, George Kadianakis, notmuch

On Thu, Sep 24 2020, David Bremner <david@tethera.net> wrote:
> George Kadianakis <desnacked@riseup.net> writes:
>
>> So I guess this ordering should happen internally in notmuch-address,
>> right? Perhaps as a new type of "--sort" option like "--most-frequent"
>> or "--best-fit".
>>
>> If this is the right way to do it, perhaps I'll take a stab at it over
>> the next days. If it's not the right way to do it, please let me know so
>> that I don't do useless things! :)
>
> there was some discussion about upstreaming some of the features of
> notmuch-addrlookup-c into notmuch-address [1]. I'm not sure what
> happened there, but maybe this helps.

I wasn't aware of notmuch-addrlookup-c as a separate tool, but I just
tried it and it looks like it could be promising.  If it has better
address sorting that definitely seems like something that would be good
to pull in upstream.

>> Hmm, I've never used this interface but if you are talking about the
>> "--output" switch I see that they can be combined. So like you can do:
>>
>>            $ notmuch address --output sender --output recipients jameson 
>>
>> to combine both To: and From:.
>
> Maybe the elisp 'internal' front-end needs to be updated to (optionally) do what
> Jamie asks.

So I don't think these are the right options to consider, but I'm not
sure.  If I'm searching for addresses associated with the user
"jameson", I think I *don't* want --output=recipients, since I imagine
that includes all the addresses that "jameson" has sent messages *to*,
which is definitely not what I would want included.  But maybe I'm not
understanding.  It seems like emacs must be creating a more nuanced set
of arguments somehow...

jamie.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: emacs: How to tab-complete destination email addresses?
  2020-09-23 16:00 emacs: How to tab-complete destination email addresses? George Kadianakis
  2020-09-23 16:20 ` Jameson Graef Rollins
@ 2020-09-29 19:46 ` Alexander Adolf
  1 sibling, 0 replies; 6+ messages in thread
From: Alexander Adolf @ 2020-09-29 19:46 UTC (permalink / raw)
  To: George Kadianakis, notmuch

Hello George,

George Kadianakis <desnacked@riseup.net> writes:

> [...]
> 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).
> [...]

Another option is to use company [1], or any other completion framework
that also offers aggregation of completion candidates from several
sources. In the default configuration, company uses notmuch-address as
one of its message mode back-ends. You can add other sources (e.g. bbdb)
easily, if they're not included in the default config already. LDAP can
also be added via EUDC [2].

[1] http://company-mode.github.io
[2] https://www.gnu.org/software/emacs/manual/html_mono/eudc.html

On a loosely related note: picking the "most relevant", or "best" match
when there's more than one candidate address, is non-trivial. "Least
recently used" is one possible heuristic, but which - when used in
isolation - will likely produce misleading results. If you send a couple
of messages to old addresses, as you described happened to you, that
would push those old addresses up in the ranking. So I guess one would
minimally also need to consider whether those addresses were sent to, or
received from. But then, if someone changes their email address, any
recommendation system would keep suggesting the old address for a
while. Hence, the only solution that works somewhat reliably, to my
experience is linking the lookup with an address book of sorts. When I
update the address book with a new address, I will be presented the new
address at the top of the candidate list.


In short terms, my suggestion is to consider using company, and link it
up with you address book application.


Cheers,

  --alex

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-29 19:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-23 16:00 emacs: How to tab-complete destination email addresses? George Kadianakis
2020-09-23 16:20 ` Jameson Graef Rollins
2020-09-24 17:03   ` George Kadianakis
2020-09-24 17:47     ` David Bremner
2020-09-24 20:09       ` Jameson Graef Rollins
2020-09-29 19:46 ` Alexander Adolf

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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).