Subject: bug#1757: 23.0.60; completion DWIM too clever

From: "Drew Adams" <[email-masked]>
Date: Thu, 1 Jan 2009 11:10:26 -0800

> >> I typed C-x b *d TAB and it offered me as completions `diary'
> >> and `old', neither of which starts with a `*'.
> >>
> >> I typed C-x b *di TAB and it completed to `diary', which is not
> >> even a completion of what I typed.
> >>
> >> It is extremely annoying to discard the user's input characters.
> >
> > I couldn't agree more. The is (the formerly optional) partial
> > completion at work. It is now the default behavior to first try
> > the traditional completion, and if that finds no matches,
> > automatically try partial completion.
> 
> Is perhaps the problem that partial completion does not respect the
> user input (of *)?

It respects it as a _wildcard_. This is a feature of partial completion. See
`completion-pcm--string->pattern' and `completion-pcm--all-completions' in
minibuffer.el.

Stefan has decided that if your input cannot be completed literally, as a
prefix, it should be completed as a wildcard pattern, using partial completion.
That is the new default behavior.

This takes away the useful negative feedback that your input has no literal
prefix completion: [No match]. Instead of letting you immediately correct a
simple typo (e.g. accidentally hitting `*' instead of some other char), you can
end up needing to correct lots of characters (e.g. `diary', as a completion of
`*di').

The problem is not that partial completion has a bug wrt *. The problem is that
partial completion is being used as an automatic fallback by default. The
assumption is that you always want to complete one way or the other - either by
treating your input as a literal prefix, if possible, or by treating it as a
wildcard expression, if literal prefix matching fails.

This "extremely annoying" feature should be optional. Partial completion is one
thing. Automatically slipping from prefix completion to partial completion is
another thing. Either of these is annoying and inappropriate as the default
behavior. And the automatic change of completing behavior is arguably more
annoying and more confusing than plain partial completion.