Subject: Re: bug#74616: 30.0.92; tmm always displays the *Completions* buffer

From: Eli Zaretskii <[email-masked]>
Date: Sat, 14 Dec 2024 12:31:28 +0200

> From: Daniel Mendler <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Wed, 11 Dec 2024 16:37:18 +0100
> 
> > Thanks.  This LGTM (but let's leave some time for others to chime in),
> > with the following nit:
> >
> >> ++++
> >> +*** New user option 'completion-eager-display'.
> >> +This option configures whether completion commands should display
> >> +the *Completions* buffer immediately.  When the variable is set to t all
> >> +completion commands show *Completions* immediately, respectively nil
> >> +disables the eager display for all commands. The default setting auto
> >                                               ^^
> > Two spaces there, please.
> 
> Thanks. Updated patch attached.

Thanks.  I was about to install this, but it turns out it breaks
minibuffer-tests:

  Test minibuffer-next-completion backtrace:
    string-match("\\(?:^\\|[^$]\\(?:\\$\\$\\)*\\)\\$\\([[:alnum:]_]*\\|{
    completion--embedded-envvar-table(nil nil metadata)
    complete-with-action(metadata completion--embedded-envvar-table nil
    #f(compiled-function (table) #<bytecode 0x1236ddf24c840ff1>)(complet
    #f(compiled-function (elt) #<bytecode 0x1c06dcd8a3b9e12b>)(completio
    mapc(#f(compiled-function (elt) #<bytecode 0x1c06dcd8a3b9e12b>) (com
    seq-do(#f(compiled-function (elt) #<bytecode 0x1c06dcd8a3b9e12b>) (c
    seq-some(#f(compiled-function (table) #<bytecode 0x1236ddf24c840ff1>
    read-file-name-internal(nil nil metadata)
    completion-metadata(nil read-file-name-internal nil)
    #f(compiled-function () #<bytecode -0x1755b58031bea2df>)()
    minibuffer-setup()
    read-from-minibuffer("Prompt: " nil (keymap (menu-bar keymap (minibu
    completing-read-default("Prompt: " read-file-name-internal nil nil n
    completing-read("Prompt: " read-file-name-internal)
    (let ((executing-kbd-macro t)) (completing-read "Prompt: " #'read-fi
    (progn (add-hook 'minibuffer-setup-hook setup-hook) (let ((executing
    (unwind-protect (progn (add-hook 'minibuffer-setup-hook setup-hook)
    (let ((fun #'(lambda nil (let ((redisplay-skip-initial-frame nil) (e
    (catch 'result (let ((fun #'(lambda nil (let (... ...) (throw ... ..
    (let ((default-directory (let* ((testfile (and t "d:/gnu/git/emacs/t
    #f(lambda () [t] (let ((default-directory (let* ... ...))) (catch 'r
    #f(compiled-function () #<bytecode -0x3a7832479b8d919>)()
    handler-bind-1(#f(compiled-function () #<bytecode -0x3a7832479b8d919
    ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
    ert-run-test(#s(ert-test :name minibuffer-next-completion :documenta
    ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m
    ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil
    ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp))))
    ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco
    eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n
    command-line-1(("-L" ";." "-l" "ert" "--eval" "(setq treesit-extra-l
    command-line()
    normal-top-level()
  Test minibuffer-next-completion condition:
      (wrong-type-argument stringp nil)
     FAILED  31/31  minibuffer-next-completion (0.001079 sec) at lisp/minibuffer-tests.el:646

  Ran 31 tests, 30 results as expected, 1 unexpected (2024-12-14 12:28:17+0200, 0.563908 sec)

  1 unexpected results:
     FAILED  minibuffer-next-completion