Re: [PATCH] Switch to DEF from INITIAL-INPUT in completing-read.
authorTomi Ollila <tomi.ollila@iki.fi>
Wed, 21 Aug 2013 19:19:11 +0000 (22:19 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:31 +0000 (09:56 -0800)
75/484334dc47ef5568e5736c1df32cce346315fe [new file with mode: 0644]

diff --git a/75/484334dc47ef5568e5736c1df32cce346315fe b/75/484334dc47ef5568e5736c1df32cce346315fe
new file mode 100644 (file)
index 0000000..2e2f78a
--- /dev/null
@@ -0,0 +1,114 @@
+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 4287F431FD4\r
+       for <notmuch@notmuchmail.org>; Wed, 21 Aug 2013 12:19:25 -0700 (PDT)\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 YEYLygCOvtld for <notmuch@notmuchmail.org>;\r
+       Wed, 21 Aug 2013 12:19:19 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id D327E431FC2\r
+       for <notmuch@notmuchmail.org>; Wed, 21 Aug 2013 12:19:18 -0700 (PDT)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+       by guru.guru-group.fi (Postfix) with ESMTP id 3F4B7100086;\r
+       Wed, 21 Aug 2013 22:19:11 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Christopher Wellons <wellons@nullprogram.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] Switch to DEF from INITIAL-INPUT in completing-read.\r
+In-Reply-To: <1377103488-7425-1-git-send-email-wellons@nullprogram.com>\r
+References: <1377103488-7425-1-git-send-email-wellons@nullprogram.com>\r
+User-Agent: Notmuch/0.16+3~g340c058 (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: Wed, 21 Aug 2013 22:19:11 +0300\r
+Message-ID: <m2r4dmrgwg.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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: Wed, 21 Aug 2013 19:19:25 -0000\r
+\r
+On Wed, Aug 21 2013, Christopher Wellons <wellons@nullprogram.com> wrote:\r
+\r
+> As stated in the Emacs documentation, the initial-input argument is\r
+> deprecated because it presents a poor interface to the user. In fact,\r
+> with my setup where ido replaces completing-read, it's nearly unusable\r
+> with initial-input.\r
+>\r
+> http://www.gnu.org/software/emacs/manual/html_node/elisp/Initial-Input.html\r
+> ---\r
+\r
+I agree that this behaves better, but the empty content with completing-read\r
+looks a bit confusing (if arrow keys or tab aren't pressed)\r
+\r
+Although the completing-read documentation also deprecates (STRING . POSITION)\r
+format IMO I found that to work best there: i.e.\r
+\r
+-   prompt collection nil nil initial-input 'notmuch-address-history))\r
++   prompt collection nil nil (cons initial-input 0) 'notmuch-address-history))\r
+\r
+\r
+I don't know how ido-replaced completing-read (just ido-completing-read ?)\r
+works there, though.\r
+\r
+Better get other thoughts/opinions too -- I use this:\r
+\r
+https://github.com/domo141/nottoomuch/blob/dogfood/selection-menu.rst\r
+\r
+for choosing completions -- it ignores INITIAL-INPUT (/DEF) argument\r
+altogether. \r
+\r
+\r
+\r
+Tomi\r
+\r
+\r
+>  emacs/notmuch-address.el | 6 +++---\r
+>  1 file changed, 3 insertions(+), 3 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el\r
+> index fa65cd5..e89200b 100644\r
+> --- a/emacs/notmuch-address.el\r
+> +++ b/emacs/notmuch-address.el\r
+> @@ -42,11 +42,11 @@ to know how address selection is made by default."\r
+>    :group 'notmuch-send\r
+>    :group 'notmuch-external)\r
+>  \r
+> -(defun notmuch-address-selection-function (prompt collection initial-input)\r
+> +(defun notmuch-address-selection-function (prompt collection def)\r
+>    "Call (`completing-read'\r
+> -      PROMPT COLLECTION nil nil INITIAL-INPUT 'notmuch-address-history)"\r
+> +      PROMPT COLLECTION nil nil nil 'notmuch-address-history DEF)"\r
+>    (completing-read\r
+> -   prompt collection nil nil initial-input 'notmuch-address-history))\r
+> +   prompt collection nil nil nil 'notmuch-address-history def))\r
+>  \r
+>  (defvar notmuch-address-message-alist-member\r
+>    '("^\\(Resent-\\)?\\(To\\|B?Cc\\|Reply-To\\|From\\|Mail-Followup-To\\|Mail-Copies-To\\):"\r
+> -- \r
+> 1.8.4.rc3\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r