unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Vincent Breitmoser <look@my.amazin.horse>, notmuch@notmuchmail.org
Subject: [PATCH] try regexp searching for completion
Date: Thu, 20 Sep 2018 21:08:39 -0300	[thread overview]
Message-ID: <20180921000839.32307-1-david@tethera.net> (raw)
In-Reply-To: <20180917210852.4346-1-look@my.amazin.horse>

---

Can you try this alternative to caching, and see if the performance is
acceptable for you? I think it should be faster than your original
implementation (and also work better with multiple word foo@beep.boop
prefixes).

For me this is performs much nicer than the "read all the addresses"
version w/o caching. This makes it nicer out of the box for users
(like me, it turns out) who don't have completion caching turned on.

I haven't come up with a completely convincing case where caching
leaks information, but two potentially interesting scenarios are as
follows:

1) users of the "notmuch-remote" hack, which shims notmuch commands
via ssh to a remote host which might be more trusted than the local
one. This is not compelling for me because I guess shimming address
completion across ssh will be unusably slow.

2) In a future implementation of protected headers which actually
understands protected From, notmuch-address might grow a --decrypt
option. This is purely hypothetical at this point.

completion/zsh/_email-notmuch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/completion/zsh/_email-notmuch b/completion/zsh/_email-notmuch
index 291c2358..1cd0d78f 100644
--- a/completion/zsh/_email-notmuch
+++ b/completion/zsh/_email-notmuch
@@ -3,7 +3,7 @@
 local expl
 local -a notmuch_addr
 
-notmuch_addr=( ${(f)"$(notmuch address --deduplicate=address --output=address -- $PREFIX'*')"} )
+notmuch_addr=( ${(f)"$(notmuch address --deduplicate=address --output=address -- from:/$PREFIX/)"} )
 
 _description notmuch-addr expl 'email address (notmuch)'
 compadd "$expl[@]" -a notmuch_addr
-- 
2.18.0

  reply	other threads:[~2018-09-21  0:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-16 22:29 [PATCH 1/2] completion: more complete completion for zsh Vincent Breitmoser
2018-09-16 22:29 ` [PATCH 2/2] debian: update zsh completion installation Vincent Breitmoser
2018-09-17 12:01 ` [PATCH 1/2] completion: more complete completion for zsh David Bremner
2018-09-17 12:15 ` Vincent Breitmoser
2018-09-17 12:49   ` David Bremner
2018-09-17 21:08     ` [PATCH] completion: load all addresses and cache in _email-notmuch Vincent Breitmoser
2018-09-21  0:08       ` David Bremner [this message]
2018-09-17 21:12     ` forgot amending the commit :) Vincent Breitmoser
2018-09-17 21:12     ` [PATCH] completion: load all addresses and cache in _email-notmuch Vincent Breitmoser
2018-09-18 11:19 ` zsh completion finalized and squashed Vincent Breitmoser
2018-09-18 11:19   ` [PATCH 1/2] completion: more complete completion for zsh Vincent Breitmoser
2018-10-03  0:40     ` David Bremner
2018-09-18 11:19   ` [PATCH 2/2] debian: update zsh completion installation Vincent Breitmoser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180921000839.32307-1-david@tethera.net \
    --to=david@tethera.net \
    --cc=look@my.amazin.horse \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).