[RFC] emacs: use ido completing read for address completion in message mode
authorMark Walters <markwalters1009@gmail.com>
Thu, 12 Jul 2012 17:54:07 +0000 (18:54 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:13 +0000 (09:48 -0800)
3e/a30a458fe00231b94e0c04d4b49154ad0d1791 [new file with mode: 0644]

diff --git a/3e/a30a458fe00231b94e0c04d4b49154ad0d1791 b/3e/a30a458fe00231b94e0c04d4b49154ad0d1791
new file mode 100644 (file)
index 0000000..799804f
--- /dev/null
@@ -0,0 +1,107 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 7C31F429E25\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Jul 2012 10:54:21 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Z6V32W+TwCd2 for <notmuch@notmuchmail.org>;\r
+       Thu, 12 Jul 2012 10:54:19 -0700 (PDT)\r
+Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com\r
+       [209.85.212.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id A7F01431FAF\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Jul 2012 10:54:19 -0700 (PDT)\r
+Received: by wibhq4 with SMTP id hq4so1938653wib.2\r
+       for <notmuch@notmuchmail.org>; Thu, 12 Jul 2012 10:54:17 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer;\r
+       bh=KJgEDuOLPuXo4EZ+K0wOu0p24mPbFa5tYRgS0yRZVDM=;\r
+       b=afiVCte6bvp/HVGCOBfWvGsanX9pF5CXmFSkeW1O20Iyr/nfe/vIpClSPbQUrN31Rf\r
+       a8hI1uxKEv3WMVBIm83EAi3IgYpOEnyYfF84VlnAJyRVl96y7t80I3a6M2q/IQuVdc3R\r
+       p0DUY3F3wTAQWviTocZ6NRAOO/Z1w2Ag5FgldB9IZ3AGQk546RyrCo8uafcf9lWKKPEN\r
+       t3gWW4dmppGdpumCXwrOb4b/WA1WgBXz3Zik0H70+beqK1vuueOgZGqhMgC+Ih2rFVNj\r
+       DaC1uXEfZiXI9cpQZXKz6j7Y7uQszkpjTISzlrUbhc9UDTZ7dpGcsGJtz2N8jM7B9/3e\r
+       6M/g==\r
+Received: by 10.216.136.72 with SMTP id v50mr4437563wei.203.1342115657041;\r
+       Thu, 12 Jul 2012 10:54:17 -0700 (PDT)\r
+Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
+ [94.192.233.223])     by mx.google.com with ESMTPS id\r
+ t8sm18233wiy.3.2012.07.12.10.54.15    (version=TLSv1/SSLv3 cipher=OTHER);     Thu,\r
+ 12 Jul 2012 10:54:15 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [RFC] emacs: use ido completing read for address completion in\r
+       message mode\r
+Date: Thu, 12 Jul 2012 18:54:07 +0100\r
+Message-Id: <1342115648-12147-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 12 Jul 2012 17:54:21 -0000\r
+\r
+This patch uses ido-completing-read for address completion in message\r
+mode.  Although ido-completing-read is nominally a drop-in replacement\r
+for completing-read `initial` and `default` behave rather differently\r
+and it makes sense to use `default` rather than `initial` in the ido\r
+case.\r
+---\r
+\r
+There was some interest on irc for using ido-completing-read for\r
+address completion in message-mode so here is a trivial patch.\r
+\r
+I am not sure I like the ido-completing-read behaviour as typing in\r
+the minibuffer matches anywhere in the address not just at the start\r
+of the address. I think there is a difference between this and setting\r
+the users from address where it is likely that many of their addresses\r
+start the same.\r
+\r
+But it might be a starting point for experiments.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+ emacs/notmuch-address.el |    6 +++---\r
+ 1 files changed, 3 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el\r
+index 2bf762b..08e0e38 100644\r
+--- a/emacs/notmuch-address.el\r
++++ b/emacs/notmuch-address.el\r
+@@ -61,9 +61,9 @@ line."\r
+                 ((eq num-options 1)\r
+                  (car options))\r
+                 (t\r
+-                 (completing-read (format "Address (%s matches): " num-options)\r
+-                                  (cdr options) nil nil (car options)\r
+-                                  'notmuch-address-history)))))\r
++                 (ido-completing-read (format "Address (%s matches): " num-options)\r
++                                  (cdr options) nil nil nil\r
++                                  'notmuch-address-history (car options))))))\r
+     (if chosen\r
+       (progn\r
+         (push chosen notmuch-address-history)\r
+-- \r
+1.7.9.1\r
+\r