From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH Date: Wed, 23 Aug 2023 15:29:53 +0000 Message-ID: References: <83jztmro8z.fsf@gnu.org> Reply-To: Heime Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21344"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 65459@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 23 17:31:21 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qYppJ-0005Mk-7I for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Aug 2023 17:31:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYpp1-0001Pd-G0; Wed, 23 Aug 2023 11:31:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYpox-0001P6-6H for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 11:30:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYpow-0007Q0-TM for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 11:30:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qYpoz-0007SA-Ut for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 11:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Heime Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 23 Aug 2023 15:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65459 X-GNU-PR-Package: emacs Original-Received: via spool by 65459-submit@debbugs.gnu.org id=B65459.169280463328597 (code B ref 65459); Wed, 23 Aug 2023 15:31:01 +0000 Original-Received: (at 65459) by debbugs.gnu.org; 23 Aug 2023 15:30:33 +0000 Original-Received: from localhost ([127.0.0.1]:34916 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYpoX-0007RB-8R for submit@debbugs.gnu.org; Wed, 23 Aug 2023 11:30:33 -0400 Original-Received: from mail-4324.protonmail.ch ([185.70.43.24]:57893) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYpoS-0007Qt-7r for 65459@debbugs.gnu.org; Wed, 23 Aug 2023 11:30:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1692804618; x=1693063818; bh=XvssCcR+ksKM3tZI5V/wcdQlg4y0WUVt6386Vjx1F6Q=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Do6UnrxvEoR/gMLtFLUAjGNjQB8HvRkkKDYAaML4meaAKcPjf0jLWRZLPFai/wxXW +AR/vVhm1plaSf6wnGlqUHz54mjSCqvn308dS9bVXUZmyrPLh39COodpZ2doB++HeI DViI/EwyFt+T9gmTAbXMhioBXsYvWIC8zuymLIS9J365N1y0zMwjGbhPVlY+O5z/7x KqWnqDJq5jonqYtGo5sB0t8AabToohuqN5aMcjXZlVwlkaVw3CkFln/ZKECgt3Sx7X Ba97OZo0YiNRBfMjNd39DfUUMpqTcdivVmIRsdPpKZT24BrhL5ZQ88a9pVRVgEAJgO 4TtIZKzSerquA== In-Reply-To: Feedback-ID: 57735886:user:proton X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:268251 Archived-At: ------- Original Message ------- On Thursday, August 24th, 2023 at 1:07 AM, Stefan Monnier wrote: > > How can we describe it - primitive - then. What lots am I missing about > > the behaviour of INITIAL-VALUE being independent about the state of the > > other variables ? >=20 > I can't really answer that because I don't fully understand what it is > you're trying to do and feel that you can't do with this API. >=20 > Maybe you're missing what other people usually miss: > `completing-read` is also used for completion of things that have > structure, like file-names, and where the INITIAL-INPUT may be a good > starting point for the user while not being a valid end point > (i.e. a choice rejected by REQUIRE-MATCH). I am aware and have no problem with the points mentioned - structured compl= etion and INITIAL-INPUT not being a valid end point with regards to REQUIRE-MATCH as = 't'. =20 > > And that entries in collection always start from index > > zero when cycling is used. >=20 > Don't know what you mean by that. Could you clarify? >=20 > By and large the COLLECTION argument is treated as a set, i.e. without > any ordering. Instead, the ordering is chosen by the UI (i.e. the > completion code) and can depend on various user config choices, so > I don't know what you mean by "always start from index zero". Consider simple cycling through completion options using the down arrow key= () in=20 the completing-read function. When using completing-read, you can cycle th= rough the=20 available completion options by pressing the 'down' arrow key. Consider (interactive (let ( (cseq '("alpha" "beta" "gamma" "delta" "epsilon" "zeta" "eta")) = ) (list (completing-read "Grapheme: " cseq nil t "alpha")) )) I have no problem with possibility of having INITIAL not in COLLECTION. But, suppose that I pre-insert the first element in collection as INITIAL value in minibuffer. =20 Then, repeatedly hit . You get alpha alpha beta gamma delta epsilon zeta eta alpha beta gamma and-so-on You do actually get that the consecutive entries appearing in the minibuffe= r have direct correspondence to to order found in COLLECTION. Once INITIAL is inserted, I cannot instruct completing-read to continue sequentially starting from a particular element. For instance, I cannot get the following result when using simple cycling= =20 through collection options when repeatedly hitting the key. To achieve alpha epsilon zeta eta alpha beta gamma delta epsilon and-so-on > I'm also not sure what you mean by "when cycling is used". Are you > referring to the first choice offered by `minibuffer-complete` when > `completion-cycle-threshold` is set to something like t? >=20 > > I have found its capability limited, having actually used it. >=20 >=20 > Are you talking about "used it" as an end-user or as a coder? As a coder and after some tests mimicking a user using only simple cycling.= =20 =20 > > I expected that as the functionalities get enhanced, some deficiencies > > also get pumped up. Giving more control to the programmer about what > > gets displayed in the minibuffer. >=20 >=20 > The intention is to try and make room for 3 parts: >=20 > - what the programmer provides to `completing-read`. > - what the end-user sees. > - between those two, the specific completion UI chosen by the end-user. >=20 > So indeed, we don't want to offer too much control to the programmer who > calls `completing-read`, so as to give more freedom to the > completion UI. - Stefan My school of thought is always allow the programmer to define how much free= dom he intends to give the completion UI.