Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 793CD4196F0 for ; Mon, 26 Apr 2010 09:25:16 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AuMNCMz+BxJx for ; Mon, 26 Apr 2010 09:25:15 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) by olra.theworths.org (Postfix) with ESMTP id A18E7431FC1 for ; Mon, 26 Apr 2010 09:25:15 -0700 (PDT) Received: by wyj26 with SMTP id 26so843822wyj.26 for ; Mon, 26 Apr 2010 09:25:14 -0700 (PDT) Received: by 10.216.86.210 with SMTP id w60mr3270989wee.48.1272299114459; Mon, 26 Apr 2010 09:25:14 -0700 (PDT) Received: from ut.hh.sledj.net (host83-217-165-81.dsl.vispa.com [83.217.165.81]) by mx.google.com with ESMTPS id d16sm172062wej.9.2010.04.26.09.25.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 26 Apr 2010 09:25:13 -0700 (PDT) Received: by ut.hh.sledj.net (Postfix, from userid 1000) id 8FA0059413B; Mon, 26 Apr 2010 17:25:24 +0100 (BST) From: dme@dme.org To: notmuch@notmuchmail.org Subject: [PATCH] emacs: Tell the user how many addresses matched when completing Date: Mon, 26 Apr 2010 17:25:21 +0100 Message-Id: <1272299121-21533-1-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.0 In-Reply-To: <87eii2ck8g.fsf@yoom.home.cworth.org> References: <87eii2ck8g.fsf@yoom.home.cworth.org> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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, 26 Apr 2010 16:25:16 -0000 From: David Edmondson When completing an address, tell the user how many addresses in the database matched the query. --- emacs/notmuch-address.el | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el index 69a52a2..a295204 100644 --- a/emacs/notmuch-address.el +++ b/emacs/notmuch-address.el @@ -53,9 +53,11 @@ line." (orig (buffer-substring-no-properties beg end)) (completion-ignore-case t) (options (notmuch-address-options orig)) - (chosen (if (eq (length options) 1) + (num-options (length options)) + (chosen (if (eq num-options 1) (car options) - (completing-read "Address: " (cdr options) nil nil (car options) + (completing-read (format "Address (%s matches): " num-options 1) + (cdr options) nil nil (car options) 'notmuch-address-history)))) (when chosen (push chosen notmuch-address-history) -- 1.7.0