From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#27158: 25.2; Eliminating old usage of completing-read from built-in files Date: Thu, 1 Jun 2017 00:20:55 +0300 Message-ID: References: <24f4a025-ad7b-06e5-10ee-f122bef32402@thompsonclan.org> <0276a0cd-874b-47ee-a2dc-fe8ca08ece9d@default> <21029018-5890-e545-8b50-ee856bc2caec@yandex.ru> <562784bd-e22b-411d-8230-4f95fe2fa7db@default> <4dfcd02b-53bc-c430-89db-f93ad6b283c2@yandex.ru> <3d3bc85b-31d3-4701-8acd-45591d075253@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1496265729 21798 195.159.176.226 (31 May 2017 21:22:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 31 May 2017 21:22:09 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Thunderbird/54.0 To: Drew Adams , Ryan , 27158@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 31 23:22:05 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGB49-0005Rg-EX for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 May 2017 23:22:05 +0200 Original-Received: from localhost ([::1]:33871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGB4E-00009B-Tg for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 May 2017 17:22:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGB49-000096-A4 for bug-gnu-emacs@gnu.org; Wed, 31 May 2017 17:22:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGB46-0006E6-64 for bug-gnu-emacs@gnu.org; Wed, 31 May 2017 17:22:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45343) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dGB46-0006Dx-2p for bug-gnu-emacs@gnu.org; Wed, 31 May 2017 17:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dGB45-0000ut-Rk for bug-gnu-emacs@gnu.org; Wed, 31 May 2017 17:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 31 May 2017 21:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27158 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27158-submit@debbugs.gnu.org id=B27158.14962656653463 (code B ref 27158); Wed, 31 May 2017 21:22:01 +0000 Original-Received: (at 27158) by debbugs.gnu.org; 31 May 2017 21:21:05 +0000 Original-Received: from localhost ([127.0.0.1]:48020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGB3B-0000tn-Cx for submit@debbugs.gnu.org; Wed, 31 May 2017 17:21:05 -0400 Original-Received: from mail-wm0-f52.google.com ([74.125.82.52]:37579) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGB39-0000sz-M2 for 27158@debbugs.gnu.org; Wed, 31 May 2017 17:21:03 -0400 Original-Received: by mail-wm0-f52.google.com with SMTP id d127so35900327wmf.0 for <27158@debbugs.gnu.org>; Wed, 31 May 2017 14:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0eCBVeZHr6a1NJEEMCxsg1PQEZLJmYEFYbGjeOVML40=; b=WHbFGKGGYPOKAvbN4cSlDz/eRapBfffKBe60cyc1U9tNkOS6q8eQyQWffa/emGoYEI ZuvmOwOvO2NSZGFUnWGIJAs2Yg0TkARNJdPRWUDVBR7WKa2v2KRCWrAG+11F1tBgSrxa gCiePVhCBE33tFRmvujSVWXw16xQ7kofoYNyaWdvCmWoubHgWZ33YEPDgl/e7VbQC2GS VCl0oTInYjX7Lo1Qn7X0iqwvu7Y6AKyi83gzcgva16dI+ZDFOssDIsss8PQzTVVlG+Qn eSYjWZGIN8GRLDErrja1mmRH7/+RRMqiIMe5xNtIVWF5UBGfhiIUI0pjtSK10UvfK/hz YjBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0eCBVeZHr6a1NJEEMCxsg1PQEZLJmYEFYbGjeOVML40=; b=PTfFSpni/zbc7UnjyjBhtc4g7eIiPRNI7xb+ffGpy5GKfoSZMPPC6Xei/+ftNTj7vh zME1F/hP9MtZ3ftvrVqjeg7YOx/WMdS0ZDeutJLnLz7dXscH5JVKyC8KHuJ0sQ1347SN kNNK5iT3sCXV/ze7cSAJqJS2gKAHnTKa1S1xsNpa2JK9h6iBoDybL+tjZsTPRU4PIdFs rfWA/k7EebKX4WtfMwQ9OmfI9SNgriMFXCVLbZK2yyxDK/9vhUwfr5rZ9Z8mKrn90CvU CapHmTmgk4imL4hfVld0zT2V63bS1R20QveBYGGHNAmaClmmSjEqfJdXZPSO5WkEq3jv jJ0w== X-Gm-Message-State: AODbwcAfrpm64TM518y/nRDr4wavPWchBFrGWcg9kW0nJhGSa8kvXwGy OFYfcXF/zNBOjlCgsDw= X-Received: by 10.28.63.209 with SMTP id m200mr6414489wma.45.1496265657537; Wed, 31 May 2017 14:20:57 -0700 (PDT) Original-Received: from [192.168.1.3] ([185.105.174.193]) by smtp.googlemail.com with ESMTPSA id i64sm864186wmd.33.2017.05.31.14.20.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 May 2017 14:20:56 -0700 (PDT) In-Reply-To: <3d3bc85b-31d3-4701-8acd-45591d075253@default> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133106 Archived-At: On 5/31/17 6:19 PM, Drew Adams wrote: >>> Just because some callers might not need it does not mean that >>> it is not useful for other callers. >> >> They can use the DEFAULT argument. > > So are you arguing that DEFAULT should be a mandatory argument? > I addressed that in my first message. No, I don't (hence the "can", not "must"). I addressed that in my first message. Go ahead and give it a read. >>>> Prohibit them from finishing completion, except through entering >>>> a valid value, or pressing C-g. >>> >>> (while ) >>> >>> Is that hard? >> >> It makes completing-read-function calling convention >> more complex for no real gain. > > So you do think that it is hard? Hard to believe. You've rephrased and misstated the above statement (which is obviously true) into something you can disagree with. Go back and read it again. > And how so, no real gain? If there is no real gain for > you then don't do it. I'm talking about what the API allows to do. You counter that with "the callers can opt not to do that". That is a useless observation. > You said you wanted to keep > prompting and getting input as long as the user tried > to exit with no input. Now you are saying that doing > that would e no real gain. (?) No, I'm saying something different. The API gives two different ways to specify the default value of "" (one explicit and one implicit). There is no benefit in it. > But if an explicit DEFAULT arg is the solution then your > completion system need only set arg DEFAULT to "" when > it is nil, no? Or set it to the first completion candidate > when it is nil or "". Or ... . Let's take ido-completing-read as an example. It shows the available options in the minibuffer right away. There are two types of callers. 1. Ones that want to see "" as the default. They are served by the current completing-read calling convention, and they can use the calling convention where "" has to be specified explicitly in the DEFAULT argument. The only difficulty is the backward compatibility and updating the existing code that is still out there. 2. Ones that don't want to see "" returned, ever, because they don't know what to do with it. Your proposed solution is: (while ) How will that look to the user faced with ido-completing-read? Suppose that function is modified to behave most compatibly with completing-read, that is, adds "" to the collection and makes it first in the list (as the default value). The user sees that "" at the beginning of the list, has to skip over it to choose a valid completion (two actions instead of one, which is especially a problem if the first real option is usually the one user will want to take), and if they choose "", nothing happens except they have to choose again, while "" still hovers annoyingly at the beginning of the list. That's ridiculous.