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