--- /dev/null
+Return-Path: <gmn-notmuch@m.gmane.org>\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 248CB431FD5\r
+ for <notmuch@notmuchmail.org>; Fri, 12 Dec 2014 00:23:22 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.165\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.165 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7, RCVD_NUMERIC_HELO=0.865]\r
+ 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 s7AHWpV59RwF for <notmuch@notmuchmail.org>;\r
+ Fri, 12 Dec 2014 00:23:17 -0800 (PST)\r
+Received: from plane.gmane.org (plane.gmane.org [80.91.229.3])\r
+ (using TLSv1 with cipher AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 3AE39431FBF\r
+ for <notmuch@notmuchmail.org>; Fri, 12 Dec 2014 00:23:17 -0800 (PST)\r
+Received: from list by plane.gmane.org with local (Exim 4.69)\r
+ (envelope-from <gmn-notmuch@m.gmane.org>) id 1XzLVG-0006HW-1o\r
+ for notmuch@notmuchmail.org; Fri, 12 Dec 2014 09:23:10 +0100\r
+Received: from 151.62.31.98 ([151.62.31.98])\r
+ by main.gmane.org with esmtp (Gmexim 0.1 (Debian))\r
+ id 1AlnuQ-0007hv-00\r
+ for <notmuch@notmuchmail.org>; Fri, 12 Dec 2014 09:23:10 +0100\r
+Received: from lele by 151.62.31.98 with local (Gmexim 0.1 (Debian))\r
+ id 1AlnuQ-0007hv-00\r
+ for <notmuch@notmuchmail.org>; Fri, 12 Dec 2014 09:23:10 +0100\r
+X-Injected-Via-Gmane: http://gmane.org/\r
+To: notmuch@notmuchmail.org\r
+From: Lele Gaifax <lele@metapensiero.it>\r
+Subject: Address completion in Emacs\r
+Date: Fri, 12 Dec 2014 09:22:56 +0100\r
+Organization: Nautilus Entertainments\r
+Lines: 53\r
+Message-ID: <87d27p9t0f.fsf@nautilus.nautilus>\r
+Mime-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: 8bit\r
+X-Complaints-To: usenet@ger.gmane.org\r
+X-Gmane-NNTP-Posting-Host: 151.62.31.98\r
+User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)\r
+Cancel-Lock: sha1:mMXYnqq7nIW1l9FgR7YMwrQTE8E=\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: Fri, 12 Dec 2014 08:23:22 -0000\r
+\r
+Hi all,\r
+\r
+Yesterday I tweaked my Emacs configuration to use "ido-completing-read"\r
+to select the right address in the minibuffer, and noticed what seems a\r
+glitch in the related code.\r
+\r
+To accomplish the goal, I implemented my own selection function\r
+\r
+ (defun esk-notmuch-address-selection-function (prompt addresses first)\r
+ "Use `ido-completing-read' to select one of the addresses."\r
+ (ido-completing-read prompt (cons first addresses)\r
+ nil nil nil 'notmuch-address-history))\r
+\r
+and then assigned it to `notmuch-address-selection-function':\r
+\r
+ (setq notmuch-address-selection-function 'esk-notmuch-address-selection-function)\r
+\r
+As you can see, I had to `cons' the two arguments, because the caller of\r
+that function does something similar to the following (where `orig' is\r
+the text entered before TAB-completion):\r
+\r
+ (options (notmuch-address-options orig))\r
+ (num-options (length options))\r
+ (chosen (funcall notmuch-address-selection-function\r
+ (format "Address (%s matches): " num-options)\r
+ (cdr options) (car options)))\r
+\r
+and the standard `notmuch-address-selection-function' is defined like:\r
+\r
+ (defun notmuch-address-selection-function (prompt collection initial-input)\r
+ "Call (`completing-read'\r
+ PROMPT COLLECTION nil nil INITIAL-INPUT 'notmuch-address-history)"\r
+ (completing-read\r
+ prompt collection nil nil initial-input 'notmuch-address-history))\r
+\r
+where that `initial-input' is not what I initially thought, the text\r
+entered by the user, but rather the first completion candidate.\r
+\r
+Wouldn't it be more "correct" to pass the unchanged `options' list and\r
+the "real" `orig' text as `initial-input' to the customizable function\r
+instead?\r
+\r
+I understand that it may be undesiderable to break existing\r
+configurations by rectifying the arguments in that way, and in such case\r
+could we change the `initial-input' argument name to better reflect the\r
+fact that it actually contains one possible candidate instead?\r
+\r
+Thanks in advance for any clarification,\r
+ciao, lele.\r
+-- \r
+nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri\r
+real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.\r
+lele@metapensiero.it | -- Fortunato Depero, 1929.\r
+\r