From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 9F7AE6DE0B0A for ; Thu, 20 Sep 2018 17:08:58 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.002 X-Spam-Level: X-Spam-Status: No, score=0.002 tagged_above=-999 required=5 tests=[AWL=0.013, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hhF3gHt5qBM3 for ; Thu, 20 Sep 2018 17:08:57 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 65AB66DE0AF5 for ; Thu, 20 Sep 2018 17:08:57 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1g3909-0005Ga-Dc; Thu, 20 Sep 2018 20:08:53 -0400 Received: (nullmailer pid 32467 invoked by uid 1000); Fri, 21 Sep 2018 00:08:52 -0000 From: David Bremner To: Vincent Breitmoser , notmuch@notmuchmail.org Subject: [PATCH] try regexp searching for completion Date: Thu, 20 Sep 2018 21:08:39 -0300 Message-Id: <20180921000839.32307-1-david@tethera.net> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180917210852.4346-1-look@my.amazin.horse> References: <20180917210852.4346-1-look@my.amazin.horse> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2018 00:08:58 -0000 --- 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