From: "João Távora" <joaotavora@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 34116@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 [thread overview]
Message-ID: <CALDnm53eqPa-dSnV6jXOJk--Swi0vVQ+Xx-wB6h8agOS4btzqg@mail.gmail.com> (raw)
In-Reply-To: <CALDnm50mXTeYtmCR4BJv0uL8pB5dK=b2yyd68QckbHMh1yo8zA@mail.gmail.com>
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@gmail.com> wrote:
>
> On Thu, Jan 17, 2019 at 2:57 PM Stefan Monnier <monnier@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
next prev parent reply other threads:[~2019-01-18 12:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-17 13:56 bug#34116: 27.0.50; minibuffer-force-complete-and-exit mostly broken João Távora
2019-01-17 14:57 ` Stefan Monnier
2019-01-17 15:03 ` João Távora
2019-01-18 12:13 ` João Távora [this message]
2019-01-18 13:09 ` Stefan Monnier
2019-01-18 13:28 ` João Távora
2019-01-18 18:00 ` Stefan Monnier
2019-01-18 22:18 ` João Távora
2019-01-19 2:31 ` Stefan Monnier
2019-01-23 15:49 ` João Távora
2019-01-23 16:09 ` Stefan Monnier
2019-01-23 16:36 ` bug#34077: " João Távora
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CALDnm53eqPa-dSnV6jXOJk--Swi0vVQ+Xx-wB6h8agOS4btzqg@mail.gmail.com \
--to=joaotavora@gmail.com \
--cc=34116@debbugs.gnu.org \
--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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.