unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Christopher Dimech <dimech@gmx.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: Michael Heerdegen <michael_heerdegen@web.de>,
	Emacs Development <emacs-devel@gnu.org>
Subject: Re: RE: [External] : Doc of deprecated INITIAL-INPUT arg of completing-read
Date: Mon, 27 Jun 2022 19:22:55 +0200	[thread overview]
Message-ID: <trinity-43ce5920-3b13-4276-9c8a-2a916493a077-1656350575338@3c-app-mailcom-bs06> (raw)
In-Reply-To: <SJ0PR10MB5488D0159B15A2C6B08A29FAF3B99@SJ0PR10MB5488.namprd10.prod.outlook.com>



> Sent: Tuesday, June 28, 2022 at 4:33 AM
> From: "Drew Adams" <drew.adams@oracle.com>
> To: "Michael Heerdegen" <michael_heerdegen@web.de>, "Emacs Development" <emacs-devel@gnu.org>
> Subject: RE: [External] : Doc of deprecated INITIAL-INPUT arg of completing-read
>
> > there was a long discussion in emacs-help about the INITIAL-INPUT
> > argument of `completing-read'.  Among other things people complained
> > about the argument being deprecated.
> >
> > I agree that it's not good to use it in nearly all cases, but there ARE
> > a few cases where it hardly can be avoided - we have over 30 uses in
> > Emacs itself.  So I want to suggest to change the docstring to warn
> > strongly about the usage of that argument, but stop saying it would be
> > deprecated.
> >
> > This is to make the current state of the code more consistent - I don't
> > plan to work on changes that had been suggested in that discussion.
> >
> > So would this patch be ok to install for now?
>
> FWIW, for my part I disagree that any "warning"
> is warranted.  There's nothing dangerous to warn
> about.
>
> I disagree with this (as I also disagree with the
> deprecation):
>
>   Using this argument is strongly discouraged--it is
>                          ^^^^^^^^^^^^^^^^^^^^
>   normally best to pass nil for INITIAL-INPUT and
>   ^^^^^^^^^^^^^
>   supply the default value DEF except in few special
>                                ^^^^^^^^^^^^^^^^^^^^^
>   cases like inserting a prefix common to all
>   completions or an initial part of a file name.
>
> There's zero reason to discourage its use in any
> blanket way, let alone "strongly" discourage.

I agree that there exists no reason to discourage it.
Nothing bad or difficult happens when it is used.


> INIT and DEF are different in behavior, and thus
> in use cases.  Telling users to use one of them
> _instead of_ the other is misguided, IMO.
>
> All that's needed is to make clear that INIT
> isn't intended as a _substitute_ for a default
> value - and vice versa.  That's really the point
> (IMO).  The use cases of INIT are different from
> those of DEF.  That's what should be made clear.
> Then leave it up to coders to use each as they
> see fit.

Right.  When people start mixing things up or hack their way to
things that creates confusion, the solution in for them to stop
with such approaches.


> But the confusion over their different uses is
> related to a missing feature, IMO, which is the
> ability for users to automatically insert the
> DEF value (not INIT) into the minibuffer, as an
> alternative to using `M-n' to insert it.
>
> Neither alternative is absolutely "better" than
> the other - this is naturally a user preference.
>
> The mistakes made in deciding to deprecate (or
> discourage) INIT-INPUT are two: (1) confusing
> it with a default value - DEF is no substitute
> for INIT, and (2) thinking that it's never a
> good UI to insert default values (DEF) in the
> minibuffer.
>
> #1 should be fixed by removing the deprecation
> and explaining the difference between the two
> (not by warning not to use INIT).
>
> #2 should be fixed by letting _users_ decide
> which DEF-inserting behavior they prefer: (1)
> automatic or (2) manual (`M-n').
>
> The choice of whether DEF should be inserted in
> the minibuffer should be up to users.  It's not
> for Emacs to decide for all and always which UI
> behavior (auto or `M-n') is better for everyone.
>
> If a user often wants to use (edit or choose)
> the default value then s?he might well want it
> to be inserted in the minibuffer.  If a user
> rarely uses the default value then s?he might
> want to insert it only manually, with `M-n'.
>
> That's really what it comes down to: having to
> delete DEF manually, if you don't want it, or
> having to insert it manually, if you do.
>
> (This is somewhat akin to the choice of whether
> to use `delete-selection-mode'.)
>
> In the help-gnu-emacs discussion you cited, I
> detailed what I would propose for #2 - I won't
> repeat details here.  I'll just say that users
> should have some way to choose whether DEF is
> to be automatically inserted in the minibuffer.
>
> (I also said there that they should have a way
> to choose whether it's inserted in the prompt.
> With my proposal, when DEF's auto-inserted in
> the minibuffer it's not inserted in the prompt,
> but users can also choose to never insert it
> in the prompt.)
>
> In any case, a missing insert-DEF-in-minibuffer
> behavior is 100% _independent_ of INIT-INPUT,
> which, yes, shouldn't be deprecated.
>
>



  reply	other threads:[~2022-06-27 17:22 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 15:22 Doc of deprecated INITIAL-INPUT arg of completing-read Michael Heerdegen
2022-06-27 16:33 ` [External] : " Drew Adams
2022-06-27 17:22   ` Christopher Dimech [this message]
2022-06-28 16:19   ` Michael Heerdegen
2022-06-28 16:40     ` Drew Adams
2022-06-29 13:42       ` Michael Heerdegen
2022-06-29 14:24         ` Drew Adams
2022-06-28 21:46     ` Christopher Dimech
2022-06-29  9:15     ` Arash Esbati
2022-06-29 13:46       ` Michael Heerdegen
2022-06-30  9:10         ` Arash Esbati
2022-07-04 12:25           ` Michael Heerdegen
2022-06-28 19:17   ` [External] : " Jean Louis
2022-06-28 19:15 ` Jean Louis
2022-06-28 21:10   ` Stefan Monnier
2022-06-28 22:00     ` Jean Louis
2022-06-29  2:58       ` Stefan Monnier
2022-06-30  3:08     ` Richard Stallman
2022-06-30 14:28       ` Stefan Monnier
2024-02-13 14:43     ` Tim Landscheidt
2024-02-13 14:59       ` Stefan Monnier
2024-02-13 17:07         ` Tim Landscheidt
2024-02-13 20:09           ` Stefan Monnier
2024-02-15  8:21             ` Tim Landscheidt
2024-02-15 16:09               ` [External] : " Drew Adams
2024-02-15 18:39               ` Stefan Monnier
2024-02-17 17:12                 ` Tim Landscheidt
2024-02-17 17:41                   ` Stefan Monnier
2022-06-30  3:08   ` Richard Stallman
2022-07-01  5:54     ` Jean Louis

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=trinity-43ce5920-3b13-4276-9c8a-2a916493a077-1656350575338@3c-app-mailcom-bs06 \
    --to=dimech@gmx.com \
    --cc=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=michael_heerdegen@web.de \
    /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).