GNU bug report logs - #64656
29.0.91; Doc of minibuffer histories and completing-read - automatic addition of completions to DEFAULT list

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Sat, 15 Jul 2023 23:36:01 UTC

Severity: minor

Found in version 29.0.91

Fixed in version 30.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #89 received at 64656 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>,
 "64656 <at> debbugs.gnu.org" <64656 <at> debbugs.gnu.org>
Subject: RE: [External] : Re: bug#64656: 29.0.91; Doc of minibuffer histories
 and completing-read - automatic addition of completions to DEFAULT
 list
Date: Mon, 13 Nov 2023 18:14:15 +0000
> >  But it's easy to restore it with a simple patch that prepends the
> >  current default value (a command at point) to the sorted list of
> >  all available command names:
> >
> > And even that doesn't seem to have much, if
> > anything, to do with adding all of the initial
> > completions to the `M-n' queue.
> > So I really don't follow you, here.
> 
> All available command names mentioned above
> are extracted from initial completions.

And?  That's the problem.  The completion domain
("initial completions") shouldn't be added to
the `M-n' queue.  At least not by default, and
IMHO, never automatically.  Any programmer is
free to add anything at all to the `M-n' queue,
including all of the initial completions, simply
by adding it to DEFAULTS.  That's what DEFAULTS
is for: to add to the `M-n' queue.

> > To be very clear, I'm opposed to the misfeature
> > of automatically jamming the initial completions
> > onto the `M-n' queue.  We have arg DEFAULTS for
> > that.  Callers of `completing-read' etc. can
> > provide exactly the list of DEFAULTS they want
> > to prepend to the `M-n' queue.
> 
> Indeed, ideally callers of `completing-read' should
> provide the exact list of defaults.

Why only "ideally"?  Anyone is always free to
add whatever they want `M-n' using DEFAULTS in
their call to `completing-read'.

> The problem
> is that it's too late to identify the existing callers
> and to add an explicit list of defaults to them.

_Programmers_ can define DEFAULTS as they like.
No one needs to, or should, try to add anything
automatically to the `M-n' queue, overriding
what a programmer has explicitly decided should
be there using DEFAULTS.

Or perhaps you mean existing `completing-read'
calls in the vanilla Emacs code, not user code?

If so, I'd say don't worry about it.  Don't
second-guess what the `M-n' queue should be for
existing `completing-read' calls.  Or if you
really want to, go ahead, investigate them one
by one.

Each call to `completing-read' deserves its own 
consideration wrt DEFAULTS (the `M-n' queue).
Nothing should ever automatically trounce what
a programmer has explicitly decided should be
in the `M-n' queue (with DEFAULTS).

> > Don't remove programmer (and user) control by
> > smothering `M-n' with the completion candidates.
> 
> This doesn't remove programmer (and user) control
> because it's still easy to add own default values
> to `M-n' and to remove initial completions from `M-n'.

It's not so easy to remove initial completions.
At a minimum, how to do that needs to be added
to the doc (this bug report).  But as Eli said,
it's more important to fix the bug of their
automatic addition than to document a workaround.




This bug report was last modified 1 year and 249 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.