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 2F66A6DE0C6B for ; Mon, 17 Sep 2018 14:09:29 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.012 X-Spam-Level: X-Spam-Status: No, score=-0.012 tagged_above=-999 required=5 tests=[AWL=0.098, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, 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 7gi3u0ObhPmM for ; Mon, 17 Sep 2018 14:09:28 -0700 (PDT) Received: from mail.mugenguild.com (mugenguild.com [5.135.189.5]) by arlo.cworth.org (Postfix) with ESMTPS id 67BB96DE0BCA for ; Mon, 17 Sep 2018 14:09:28 -0700 (PDT) Received: from localhost (i59F77CE8.versanet.de [89.247.124.232]) by mail.mugenguild.com (Postfix) with ESMTPSA id 0C0FC5FA07; Mon, 17 Sep 2018 23:09:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=my.amazin.horse; s=mail; t=1537218565; bh=LmcITKqvFg/J0soq7+RjoTNBnuj1o28iEfqy2a0Bf4o=; h=From:To:Subject:Date:From; b=eZM/hHsmV2ASg6jq0PlFvtwsBLVxDFa5ue5jIVvRxJACc9shrm0FFJkwedLzdko7m I33fSfKl8+Ij9h7HyYs960H8RpReFbqm5wEqC/jbhJvNcQ/7Qmv5hshdMgomOzcV8O Q8L3OolRpxQ3CjjF6QNkSqk3Id8KFUpiYCO0MHHs= From: Vincent Breitmoser To: notmuch@notmuchmail.org Subject: [PATCH] completion: load all addresses and cache in _email-notmuch Date: Mon, 17 Sep 2018 23:08:52 +0200 Message-Id: <20180917210852.4346-1-look@my.amazin.horse> X-Mailer: git-send-email 2.18.0 In-Reply-To: <871s9si90d.fsf@tethera.net> References: <871s9si90d.fsf@tethera.net> 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: Mon, 17 Sep 2018 21:09:29 -0000 --- completion/zsh/_email-notmuch | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/completion/zsh/_email-notmuch b/completion/zsh/_email-notmuch index 291c2358..c6db00b6 100644 --- a/completion/zsh/_email-notmuch +++ b/completion/zsh/_email-notmuch @@ -2,8 +2,14 @@ local expl local -a notmuch_addr +local notmuch_addr_lastmod +local lastmod=( ${(f)"$(notmuch count --lastmod)"} ) -notmuch_addr=( ${(f)"$(notmuch address --deduplicate=address --output=address -- $PREFIX'*')"} ) +if ! _retrieve_cache notmuch-addresses || [[ $lastmod != $notmuch_addr_lastmod ]]; then + notmuch_addr_lastmod=$lastmod + notmuch_addr=( ${(f)"$(notmuch address --deduplicate=address --output=address -- '*')"} ) + _store_cache notmuch-addresses notmuch_addr notmuch_addr_lastmod +fi _description notmuch-addr expl 'email address (notmuch)' compadd "$expl[@]" -a notmuch_addr -- 2.18.0