unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Jordan Ellis Coppard <jc+o.emacs@wz.ht>
Cc: 73473@debbugs.gnu.org
Subject: bug#73473: 31.0.50; Minibuffer completions include nonsense prefix candidates
Date: Fri, 27 Sep 2024 11:35:00 -0400	[thread overview]
Message-ID: <jwva5ftun5t.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <jwvfrpluouk.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 27 Sep 2024 11:12:01 -0400")

[-- Attachment #1: Type: text/plain, Size: 433 bytes --]

> AFAICT, there is a performance bug here in that just doing the
> `C-h o PREF TAB` which completes to `PREFIX-` already loads `PREFIX.el`
> which is a bit over-enthusiatic (I intended it to load `PREFIX.el`
> only when you hit TAB while you already have `PREFIX-` in your
> minibuffer).

The patch below seems to fix this performance bug in my test.
Can you see if it avoids the major slowdown you're experiencing?


        Stefan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: completion-autoload.patch --]
[-- Type: text/x-diff, Size: 941 bytes --]

diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index e1daa8977f0..a9634745282 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -206,9 +206,12 @@ help--symbol-completion-table
         ,@(when completions-detailed
             '((affixation-function . help--symbol-completion-table-affixation)))
         (category . symbol-help))
-    (when help-enable-completion-autoload
+    (when (and help-enable-completion-autoload
+               (memq action '(nil t lambda)))
       (let ((prefixes (radix-tree-prefixes (help-definition-prefixes) string)))
-        (help--load-prefixes prefixes)))
+        ;; Don't load FOO.el during `test-completion' of `FOO-'.
+        (unless (and (eq action 'lambda) (assoc string prefixes))
+          (help--load-prefixes prefixes))))
     (let ((prefix-completions
            (and help-enable-completion-autoload
                 (mapcar #'intern (all-completions string definition-prefixes)))))

      reply	other threads:[~2024-09-27 15:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 10:54 bug#73473: 31.0.50; Minibuffer completions include nonsense prefix candidates Jordan Ellis Coppard via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-25 16:09 ` Eli Zaretskii
2024-09-26  6:21   ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-27 15:12   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-27 15:35     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwva5ftun5t.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=73473@debbugs.gnu.org \
    --cc=jc+o.emacs@wz.ht \
    --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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).