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