GNU bug report logs - #34116
27.0.50; minibuffer-force-complete-and-exit mostly broken

Previous Next

Package: emacs;

Reported by: João Távora <joaotavora <at> gmail.com>

Date: Thu, 17 Jan 2019 13:57:02 UTC

Severity: normal

Tags: patch

Found in version 27.0.50

Done: João Távora <joaotavora <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: João Távora <joaotavora <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 34116 <at> debbugs.gnu.org
Subject: bug#34116: 27.0.50; minibuffer-force-complete-and-exit mostly broken
Date: Fri, 18 Jan 2019 12:13:06 +0000
I'm going to change my stance on this, but just a little.
I trid your approach, passing minibuffer-completion-table
and minibuffer-completion-predicate and some "reasonable"
string to try-completion.

It seems to work most of the times, but I could swear it is
is doing mischief in some situations (can't tell which tho).

Other arguments against it is that it shouldn't be necessary
to query the table again by this point, which is potentially
slow and could have side effects depending on the table.

In other words, there is some arguably poorly chosen cons
juggling going on in minibuffer-force-complete.  My fix adds
to that, but at least it stays within the same idiom.

So if you don't mind I'd fix this rather serious bug with my
safer fix, and later we can use your try-completion approach.

João



On Thu, Jan 17, 2019 at 3:11 PM João Távora <joaotavora <at> gmail.com> wrote:
>
> On Thu, Jan 17, 2019 at 2:57 PM Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
> >
> > > @@ -1257,29 +1257,32 @@ completion-all-sorted-completions
> > >  (defun minibuffer-force-complete-and-exit ()
> > >    "Complete the minibuffer with first of the matches and exit."
> > >    (interactive)
> > > -  (minibuffer-force-complete)
> > > +  (minibuffer-force-complete nil nil t)
> > >    (completion--complete-and-exit
> > >     (minibuffer-prompt-end) (point-max) #'exit-minibuffer
> > >     ;; If the previous completion completed to an element which fails
> > >     ;; test-completion, then we shouldn't exit, but that should be rare.
> > >     (lambda () (minibuffer-message "Incomplete"))))
> >
> > Wouldn't it be simpler to change minibuffer-force-complete-and-exit so
> > it checks test-completion before calling minibuffer-force-complete?
>
> Makes sense.  As I explained elsewhere, I am a total completion API
> newbie.  I'm always unsure what to pass to these functions and the
> dark logic they engage in.  On the contrary, my change is based on
> cons cells, which I still understand :-)
>
> But your suggestion makes perfect sense and I'd be very
> thankful if you could do it yourself (if it is as trivial as it sounds).
>
> João Távora
>
>
>


--
João Távora




This bug report was last modified 6 years and 120 days ago.

Previous Next


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