]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: Tell the user how many addresses matched when completing
authorDavid Edmondson <dme@dme.org>
Mon, 26 Apr 2010 16:25:21 +0000 (17:25 +0100)
committerCarl Worth <cworth@cworth.org>
Mon, 26 Apr 2010 17:58:42 +0000 (10:58 -0700)
When completing an address, tell the user how many addresses in the
database matched the query.

Edited-by: Carl Worth <cworth@cworth.org>: Removed a stray numeric
literal that was causing a compiler warning.

emacs/notmuch-address.el

index 69a52a295a59404b70bc8a9d8d75e809a083931b..1a7c5771ad9931650bdeed2a9fdab8ed51d81260 100644 (file)
@@ -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)
+                                   (cdr options) nil nil (car options)
                                    'notmuch-address-history))))
     (when chosen
       (push chosen notmuch-address-history)