From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Cc: "João Távora" <joaotavora@gmail.com>
Subject: Re: scratch/backend-completion aaaa016056 2/2: Speed it up
Date: Sat, 03 Dec 2022 09:10:41 -0500 [thread overview]
Message-ID: <jwv359w37li.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20221203131739.3FCF9C004BE@vcs2.savannah.gnu.org> ("João Távora"'s message of "Sat, 3 Dec 2022 08:17:39 -0500 (EST)")
> diff --git a/lisp/external-completion.el b/lisp/external-completion.el
> index da3a986b8c..25e94e540b 100644
> --- a/lisp/external-completion.el
> +++ b/lisp/external-completion.el
> @@ -104,8 +104,10 @@ taking a (STRING POINT) as arguments. The default is to set to
> `(external-completion-allc . ,(if pred (seq-filter pred all) all))))
> (`(boundaries . ,_) nil)
> (_
> - (let ((all (funcall lookup string (length string))))
> - (complete-with-action action all string pred))))))
> + ;; FIXME: Stefan had a call to `lookup' and
> + ;; `complete-with-action' again here, but that just seems to
> + ;; slow down things for no good reason, so I took it out.
> + ))))
The code was definitely needed for some cases like `try-completion`
and `all-completions` (e.g. to make sure we only return completion
of the `string` *prefix* as callers of those functions expect and to
make sure we obey `pred`).
But I'm surprised it made things slow: this code should only be involved
when the user choose some *other* completion style, so could you check
which method of the completion table was invoked?
Maybe we should only use that code when `action` is one of `t` or `nil`?
Stefan
next parent reply other threads:[~2022-12-03 14:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <167007345844.23701.8454474119701440468@vcs2.savannah.gnu.org>
[not found] ` <20221203131739.3FCF9C004BE@vcs2.savannah.gnu.org>
2022-12-03 14:10 ` Stefan Monnier [this message]
2022-12-03 23:30 ` scratch/backend-completion aaaa016056 2/2: Speed it up João Távora
2022-12-04 0:18 ` Stefan Monnier
2022-12-04 11:11 ` João Távora
[not found] ` <20221203131739.2A601C004BA@vcs2.savannah.gnu.org>
2022-12-03 14:26 ` scratch/backend-completion 9a62da21c2 1/2: Integrate Stefan suggestions but rename it to "external-completion.el" Stefan Monnier
2022-12-03 23:36 ` João Távora
2022-12-04 0:31 ` Stefan Monnier
2022-12-04 10:02 ` João Távora
2022-12-04 16:54 ` Stefan Monnier
2022-12-04 20:04 ` João Távora
2022-12-06 0:14 ` Stefan Monnier
2022-12-07 11:09 ` João Távora
2022-12-07 13:56 ` Eli Zaretskii
2022-12-07 19:09 ` 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=jwv359w37li.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=joaotavora@gmail.com \
/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.