unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH v1 0/3] Address completion entirely in elisp.
@ 2014-09-05 12:59 David Edmondson
  2014-09-05 15:29 ` Mark Walters
  0 siblings, 1 reply; 4+ messages in thread
From: David Edmondson @ 2014-09-05 12:59 UTC (permalink / raw)
  To: notmuch


Address completion entirely in elisp.

I grew frustrated with having to use an external command to provide
address completion, as they all had annoyances (up front scanning,
requiring python bindings, etc.). This is an attempt to provide
something similar to jkr's notmuch-addresses.py (which I was
previously using) entirely in elisp, relying only on the `notmuch'
command.


David Edmondson (3):
  emacs: Allow query to exclude the entire thread and body.
  emacs: Add `notmuch-user-all-email'.
  emacs: Add an address completer in elisp.

 emacs/notmuch-address.el | 49 +++++++++++++++++++++++++++++++++++++++++++-----
 emacs/notmuch-lib.el     |  4 ++++
 emacs/notmuch-query.el   |  7 ++++++-
 3 files changed, 54 insertions(+), 6 deletions(-)

-- 
1.8.5.2 (Apple Git-48)

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

* Re: [PATCH v1 0/3] Address completion entirely in elisp.
  2014-09-05 12:59 David Edmondson
@ 2014-09-05 15:29 ` Mark Walters
  2014-09-05 16:06   ` David Edmondson
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Walters @ 2014-09-05 15:29 UTC (permalink / raw)
  To: David Edmondson, notmuch


Hi

On Fri, 05 Sep 2014, David Edmondson <dme@dme.org> wrote:
> Address completion entirely in elisp.
>
> I grew frustrated with having to use an external command to provide
> address completion, as they all had annoyances (up front scanning,
> requiring python bindings, etc.). This is an attempt to provide
> something similar to jkr's notmuch-addresses.py (which I was
> previously using) entirely in elisp, relying only on the `notmuch'
> command.

Just a few quick comments: the first is relevant to others trying this
patch.

1) You seem to be missing a (require 'std11) somewhere. I did this via M-:
and then it ran fine.

2) It is not quick on a spinning rust disk. This may not be relevant as
the delay is probably notmuch so would also be the case if I were using
notmuch-addresses.py (i normally just use a trivial script that parses
my .mailrc)

3) Have you tried
id:1407771091-12651-1-git-send-email-sojkam1@fel.cvut.cz and do you have
any comments on the comparison?

4) Finally, I wonder if we would be worth approaching the backend
notmuch use slightly differently: if we added a
notmuch_messages_collect_from function which was very similar to
notmuch_messages_collect_tags, and added a corresponding --output=from
to notmuch search then you would get the information you need very
quickly. I think it might be a lot faster as I think the from header is
stored in the database but some other headers are not, so that the
current method the show --body=false needs to look at the actually
messages

I should emphasise that none of the above means I am opposed to the
patch: having respectable built in address-completion support would be
very nice.

Best wishes

Mark




>
>
> David Edmondson (3):
>   emacs: Allow query to exclude the entire thread and body.
>   emacs: Add `notmuch-user-all-email'.
>   emacs: Add an address completer in elisp.
>
>  emacs/notmuch-address.el | 49 +++++++++++++++++++++++++++++++++++++++++++-----
>  emacs/notmuch-lib.el     |  4 ++++
>  emacs/notmuch-query.el   |  7 ++++++-
>  3 files changed, 54 insertions(+), 6 deletions(-)
>
> -- 
> 1.8.5.2 (Apple Git-48)
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH v1 0/3] Address completion entirely in elisp.
  2014-09-05 15:29 ` Mark Walters
@ 2014-09-05 16:06   ` David Edmondson
  0 siblings, 0 replies; 4+ messages in thread
From: David Edmondson @ 2014-09-05 16:06 UTC (permalink / raw)
  To: Mark Walters, notmuch

On Fri, Sep 05 2014, Mark Walters wrote:
> On Fri, 05 Sep 2014, David Edmondson <dme@dme.org> wrote:
>> Address completion entirely in elisp.
>>
>> I grew frustrated with having to use an external command to provide
>> address completion, as they all had annoyances (up front scanning,
>> requiring python bindings, etc.). This is an attempt to provide
>> something similar to jkr's notmuch-addresses.py (which I was
>> previously using) entirely in elisp, relying only on the `notmuch'
>> command.
>
> Just a few quick comments: the first is relevant to others trying this
> patch.
>
> 1) You seem to be missing a (require 'std11) somewhere. I did this via M-:
> and then it ran fine.

My apologies. Will fix (and a compiler warning at the same time).

> 2) It is not quick on a spinning rust disk. This may not be relevant as
> the delay is probably notmuch so would also be the case if I were using
> notmuch-addresses.py (i normally just use a trivial script that parses
> my .mailrc)

It's not always as fast as I would like on SSD either :-) The mechanism
is very similar to the equivalent Python program, so I think that it's
probably about the same.

> 3) Have you tried
> id:1407771091-12651-1-git-send-email-sojkam1@fel.cvut.cz and do you have
> any comments on the comparison?

No, I will dig it out and look.

> 4) Finally, I wonder if we would be worth approaching the backend
> notmuch use slightly differently: if we added a
> notmuch_messages_collect_from function which was very similar to
> notmuch_messages_collect_tags, and added a corresponding --output=from
> to notmuch search then you would get the information you need very
> quickly. I think it might be a lot faster as I think the from header is
> stored in the database but some other headers are not, so that the
> current method the show --body=false needs to look at the actually
> messages

Extending notmuch to help with this was next on my list of things to
do. At the moment I just needed a solution that worked.

> I should emphasise that none of the above means I am opposed to the
> patch: having respectable built in address-completion support would be
> very nice.

Cool, thanks!

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

* Re: [PATCH v1 0/3] Address completion entirely in elisp.
@ 2014-09-06  1:36 Trevor Jim
  0 siblings, 0 replies; 4+ messages in thread
From: Trevor Jim @ 2014-09-06  1:36 UTC (permalink / raw)
  To: David Edmondson; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 245 bytes --]

You might want to take a look at the elisp-only completion I wrote for nevermore.
Address harvesting is pretty fast and anyway is asynchronous.

https://github.com/tjim/nevermore/blob/42febedb45da6158e26503359f864f772d332de0/nm.el#L561


[-- Attachment #2.1: Type: text/html, Size: 395 bytes --]

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

end of thread, other threads:[~2014-09-06  1:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-06  1:36 [PATCH v1 0/3] Address completion entirely in elisp Trevor Jim
  -- strict thread matches above, loose matches on Subject: below --
2014-09-05 12:59 David Edmondson
2014-09-05 15:29 ` Mark Walters
2014-09-05 16:06   ` David Edmondson

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