--- /dev/null
+Return-Path: <tomi.ollila@iki.fi>\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 A6630431FB6\r
+ for <notmuch@notmuchmail.org>; Sun, 14 Dec 2014 09:27:41 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\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 2IOBovwdyWoF for <notmuch@notmuchmail.org>;\r
+ Sun, 14 Dec 2014 09:27:38 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 2AE8F431FAF\r
+ for <notmuch@notmuchmail.org>; Sun, 14 Dec 2014 09:27:38 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id D39D8100033;\r
+ Sun, 14 Dec 2014 19:27:08 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Lele Gaifax <lele@metapensiero.it>, notmuch@notmuchmail.org\r
+Subject: Re: Address completion in Emacs\r
+In-Reply-To: <87d27p9t0f.fsf@nautilus.nautilus>\r
+References: <87d27p9t0f.fsf@nautilus.nautilus>\r
+User-Agent: Notmuch/0.19+6~g8725b09 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Sun, 14 Dec 2014 19:27:08 +0200\r
+Message-ID: <m2iohedtw3.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\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: Sun, 14 Dec 2014 17:27:41 -0000\r
+\r
+On Fri, Dec 12 2014, Lele Gaifax wrote:\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=\r
+-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-in=\r
+put)\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 think I am to be blamed why that is like this -- initially there were\r
+no notmuch-address-selection-function ... I added as I needed it, in\r
+\r
+Stashed: id:1365001734-3160-1-git-send-email-tomi.ollila@iki.fi\r
+Stashed: http://mid.gmane.org/1365001734-3160-1-git-send-email-tomi.ollila@=\r
+iki.fi\r
+\r
+and I was not smart enough to do the splitting in "standard\r
+notmuch-address-selection-function".=20=20\r
+\r
+Later, someone(*) provided patch which would make the "standard" interface\r
+work better with ido-completing-read -- unfortunately that made the\r
+default, original interface which uses completing-read borken.\r
+\r
+Personally I'd like to see leaner interface there, but that is incompatible\r
+change and in this particular case I don't see compelling reason to do that=\r
+...=20\r
+\r
+(*) cannot remember who and when, and I am writing this mail on a Mac and\r
+the use is painful enough now (keybindings, focus behaviour, etc...);/\r
+\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
+Naming change would indeed be a good idea... (probably?!)=20=20\r
+\r
+>\r
+> Thanks in advance for any clarification,\r
+> ciao, lele.\r
+\r
+Tomi\r
+\r
+> --=20\r
+> nickname: Lele Gaifax | Quando vivr=C3=B2 di quello che ho pensato ieri\r
+> real: Emanuele Gaifas | comincer=C3=B2 ad aver paura di chi mi copia.\r
+> lele@metapensiero.it | -- Fortunato Depero, 1929.\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r