unofficial mirror of bug-gnu-emacs@gnu.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: Thu, 24 Aug 2023 14:51:29 +0000	[thread overview]
Message-ID: <ZnU7o5ta2Yj00sCa0fTbOaRW3DCJh4szyru5E8hqOFTUKqhbj6QZThi7DYp9_AfixePN0kajs7RRptmvVNCJ2Ye-XtrSViMJalH9T8KVNwE=@protonmail.com> (raw)
In-Reply-To: <jwv7cpk6070.fsf-monnier+emacs@gnu.org>


------- Original Message -------
On Friday, August 25th, 2023 at 1:36 AM, Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> wrote:

> > It is not, because the intention is on prefilling the minibuffer with
> > "alpha" rather than considering "alpha" as DEF.
> 
> Could you explain why this is important in your case?

There purpose of INITIAL has always been about prefilling the minibuffer.
No other 'completing-read' functionality can do such a thing.  DEF has
always served a different purpose.  For some reason that I cannot understand,
most of the communications I have try to persuade me to set INITIAL to nil.
INITIAL had a purpose, which under certain circumstances has implications
to the way COLLECTION is constructed and used.  Rather than fixing the 
difficulties for certain cases, the answer has always been the same, put 
INITIAL to nil and just don't use it, and use DEF if you want.  Even though
Default Settings and Minibuffer Prefilling result in two completely distinct  
behaviours.
 
> > It appears that the maintainers might not be prioritizing the initial
> > intention of prefilling the minibuffer. Currently, their emphasis
> > seems to be on encouraging developers to either utilize the "DEF"
> > approach or actively discourage the use of "INITIAL". But, I haven't
> > come across a clear and well-founded reasoning behind these shifts
> > in approach.
> 
> Not sure what you mean by "shifts". AFAIK this behavior has been with
> Emacs "forever": most minibuffers start empty (but with an associated
> default value) rather than starting with an initial value.

Right.  Because most minibuffers start empty (but with an associated
default value) rather than starting with an initial value, this particular
use of 'completing-read' in today considered to be the only way to use 
'completing-read'.  Something that is completely wrong because a particular
use case has now became dogma.  One cannot ever disregard the different feature
provided by INITIAL for those who want to use it. 
 
> This originally comes presumably from the absence of
> `transient-mark-mode` (or associated visual highlighting, both of which
> were introduced in Emacs-19) which means that it was annoying having to
> erase "alpha" before you can type "beta".
> 
> Starting with a non-empty minibuffer does happen occasionally, most
> importantly for `read-file-name` where we do expect that this initial
> input will very likely be a part of the name the user will end up
> typing, so its rare that the users need to erase it before they can type
> the file name they want.

Right.  Although it is customarily rare, INITIAL does actually have relevant
use cases.  It just happens that over time, additional use cases have cropped
up.  Rarity seams to have became a reason to discourage use of INITIAL.  Such
school of thought is seriously misguided.  
 
> > But this is only easily done only when collection is actually being
> > constructed in-place via the 'let' clause. But once COLLECTION
> > starts getting imported from somewhere else (via a call to same other
> > function for instance), your suggested solution is impossible
> > to achieve.
> 
> That's partly why I've asked about a concrete example showing the wider
> context :-) - Stefan

I am working on an emacs org library for archeological investigations where
field practitioners can insert specific org templates detailing the progress
of excavations and finds.  Each phase is categorised.

For instance

"Physical_Analysis" "Chronological Dating" "Composition and Provenance" "Isotope Analysis"

And there exists a certain order.  It would be difficult to change that order on-the-fly 
just to make 'completing-read' happy. With each exists specific templates that practitioners
can introduce and elaborate.  Once certain aspects are completed, the previous categorisations
would be skipped, because they would no longer be relevant.  What gets shown is then directed
towards improving productivity, particularly when tight deadlines are imposed.  

Tight deadlines in archaeological field excavations arise from a variety of logistical and 
operational factors).  For instance, certain sites are threatened by construction or development
projects, with limited timeframes to excavate and document findings.  Some sites are at risk of
deterioration due to environmental factors (e.g. flooding, collapse), meaning that emergency 
excavations within short timeframes to salvage artifacts and information becomes necessary.

Such application should be concrete enough.









  reply	other threads:[~2023-08-24 14:51 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
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 [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='ZnU7o5ta2Yj00sCa0fTbOaRW3DCJh4szyru5E8hqOFTUKqhbj6QZThi7DYp9_AfixePN0kajs7RRptmvVNCJ2Ye-XtrSViMJalH9T8KVNwE=@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).