all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Heime via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Eli Zaretskii <eliz@gnu.org>, 65459@debbugs.gnu.org
Subject: bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH
Date: Wed, 23 Aug 2023 15:29:53 +0000	[thread overview]
Message-ID: <WGPneIBtyarvwY_U4xDeNuwtGXJIGuLxxvX2PFDeFHH01k8NRYg0fuQIEcrnkmGagCNWILPuTDtbh3tc1bqkp5DKdTEPolnkb_AgdJNfVa8=@protonmail.com> (raw)
In-Reply-To: <jwvv8d57wdc.fsf-monnier+emacs@gnu.org>


------- Original Message -------
On Thursday, August 24th, 2023 at 1:07 AM, Stefan Monnier <monnier@iro.umontreal.ca> 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 ?
> 
> 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.
> 
> 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 completion and
INITIAL-INPUT not being a valid end point with regards to REQUIRE-MATCH as 't'.
 
> > And that entries in collection always start from index
> > zero when cycling is used.
> 
> Don't know what you mean by that. Could you clarify?
> 
> 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 (<down>) in 
the completing-read function.  When using completing-read, you can cycle through the 
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.
 
Then, repeatedly hit <down>.  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 minibuffer
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 
through collection options when repeatedly hitting the <down> 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?
> 
> > I have found its capability limited, having actually used it.
> 
> 
> 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. 
 
> > 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.
> 
> 
> The intention is to try and make room for 3 parts:
> 
> - what the programmer provides to `completing-read`.
> - what the end-user sees.
> - between those two, the specific completion UI chosen by the end-user.
> 
> 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 freedom
he intends to give the completion UI.






  reply	other threads:[~2023-08-23 15:29 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22 22:04 bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-23 11:29 ` Eli Zaretskii
2023-08-23 11:57   ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-23 13:07     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-23 15:29       ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-08-23 16:05         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-23 16:39           ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-23 16:58             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-23 18:12               ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-23 21:27                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-23 22:44                   ` Drew Adams
2023-08-23 23:06                   ` Gregory Heytings
2023-08-24  2:30                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-24 12:30                       ` Gregory Heytings
2023-08-24 13:19                         ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-25  6:59                           ` Juri Linkov
2023-08-24 13:46                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-26  8:06                           ` Gregory Heytings
2023-08-31  9:42                             ` Eli Zaretskii
2023-09-04 21:35                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-04 22:16                               ` Stefan Kangas
2023-09-05 11:05                               ` Eli Zaretskii
2023-09-05 12:59                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-05 13:14                                   ` Eli Zaretskii
2023-08-24  9:02                   ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-24 13:36                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-24 14:51                       ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-24 16:45                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-24 18:50                           ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-24 19:35                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-24 20:22                               ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-24 21:02                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-24 21:45                                   ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-26  8:10                                   ` Gregory Heytings
2023-08-26 14:27                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-27  6:45                                       ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-27 14:40                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-27 16:21                                           ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-27 16:26                                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-27 16:35                                               ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-27 18:01                                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-27 21:11                                                   ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-27 21:48                                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-27 22:59                                                       ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-28  3:12                                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-28  9:14                                                           ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-28 12:44                                                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-28 12:50                                                               ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-28 13:04                                                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-28 13:13                                                                   ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-27 16:42                                               ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-27 18:02                                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-27 20:54                                                   ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-27 21:26                                                   ` Heime via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='WGPneIBtyarvwY_U4xDeNuwtGXJIGuLxxvX2PFDeFHH01k8NRYg0fuQIEcrnkmGagCNWILPuTDtbh3tc1bqkp5DKdTEPolnkb_AgdJNfVa8=@protonmail.com' \
    --to=bug-gnu-emacs@gnu.org \
    --cc=65459@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=heimeborgia@protonmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.