On Sun, Dec 4, 2022 at 12:18 AM Stefan Monnier wrote: > > >> 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? > > It seems to be called with both `nil` and `lambda`. I've added this to the > > FIXME comment. > > Hmm... can you get a backtrace for when it's called with `nil`? See after my sig: > > It made things slow because when selecting a candidate with > > fido-vertical-mode it did another useless 0.5s/1s lookup for the thing > > I had just selected. > > Yes, it's only meant as a fallback case (and if we intend it to work > more or less acceptably we'd need to add some caching). Been there, done that :-) > >> Maybe we should only use that code when `action` is one of `t` or `nil`? > > Maybe. Anyway in my tests it's working fine without it. But `nil` doesn't > > break them, so I'm fine if you add them. I'm just confused about the > > possible benefits that may come from that complexity. I wish you could > > post an illustrative example with some strings that a mere mortal might > > follow along. > > As I said, it's for the case where the users want to use that completion > table with another completion-style. See the comment block. I think we should just error if the user tries to do that. João Here's the backtrace you ordered, sir: Debugger entered: nil #f(compiled-function (--cl-lookup-internal-- string pred action method) #)(#f(compiled-function (string point) #) "doc/misc/eglot.texi" nil nil nil) #f(compiled-function (string pred action) #)("doc/misc/eglot.texi" nil nil) try-completion("doc/misc/eglot.texi" #f(compiled-function (string pred action) #) nil) completion--complete-and-exit(41 60 exit-minibuffer #f(compiled-function () #)) minibuffer-force-complete-and-exit() icomplete-force-complete-and-exit() icomplete-fido-ret() funcall-interactively(icomplete-fido-ret) call-interactively(icomplete-fido-ret nil nil) command-execute(icomplete-fido-ret) read-from-minibuffer("Eel find file in ~/Source/Emacs/emacs/: " nil (keymap (menu-bar keymap (minibuf "Minibuf" keymap (tab menu-item "Complete" minibuffer-complete :help "Complete as far as possible") (space menu-item "Complete Word" minibuffer-complete-word :help "Complete at most one word") (63 menu-item "List Completions" minibuffer-completion-help :help "Display all possible completions") "Minibuf")) (M-down . minibuffer-next-completion) (M-up . minibuffer-previous-completion) (27 keymap (13 . minibuffer-choose-completion) (103 keymap (27 keymap (99 . switch-to-completions))) (118 . switch-to-completions)) (prior . switch-to-completions) (63 . minibuffer-completion-help) (32 . minibuffer-complete-word) (backtab . minibuffer-complete) (9 . minibuffer-complete) keymap (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the min...") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuf...") (isearch-backward menu-item "Isearch History Backward" isearch-backward :help "Incrementally search minibuffer history backward") (isearch-forward menu-item "Isearch History Forward" isearch-forward :help "Incrementally search minibuffer history forward") (return menu-item "Enter" exit-minibuffer :key-sequence "\15" :help "Terminate input and exit minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and exit minibuffer") "Minibuf")) (24 keymap (down . minibuffer-complete-defaults) (up . minibuffer-complete-history)) (13 . exit-minibuffer) (10 . exit-minibuffer) (7 . minibuffer-keyboard-quit) (C-tab . file-cache-minibuffer-complete) (9 . self-insert-command) (XF86Back . previous-history-element) (up . previous-line-or-history-element) (prior . previous-history-element) (XF86Forward . next-history-element) (down . next-line-or-history-element) (next . next-history-element) (27 keymap (60 . minibuffer-beginning-of-buffer) (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) nil nil nil nil) completing-read-default("Eel find file in ~/Source/Emacs/emacs/: " #f(compiled-function (string pred action) #) nil nil nil nil nil nil) completing-read("Eel find file in ~/Source/Emacs/emacs/: " #f(compiled-function (string pred action) #) nil nil nil nil) eel-find-file("~/Source/Emacs/emacs/") funcall-interactively(eel-find-file "~/Source/Emacs/emacs/") call-interactively(eel-find-file nil nil) command-execute(eel-find-file)