GNU bug report logs - #73473
31.0.50; Minibuffer completions include nonsense prefix candidates

Previous Next

Package: emacs;

Reported by: Jordan Ellis Coppard <jc+o.emacs <at> wz.ht>

Date: Wed, 25 Sep 2024 14:26:02 UTC

Severity: normal

Merged with 72787, 73092

Found in version 31.0.50

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jordan Ellis Coppard <jc+o.emacs <at> wz.ht>
Cc: 73473 <at> debbugs.gnu.org
Subject: bug#73473: 31.0.50; Minibuffer completions include nonsense prefix candidates
Date: Fri, 27 Sep 2024 11:35:00 -0400
[Message part 1 (text/plain, inline)]
> 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
[completion-autoload.patch (text/x-diff, inline)]
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)))))

This bug report was last modified 263 days ago.

Previous Next


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