Subject: bug#68801: 30.0.50; minibuffer-visible-completions=t makes RET in completion-in-region a no-op with nothing selected

From: Juri Linkov <[email-masked]>
Date: Sun, 18 Feb 2024 09:46:35 +0200

> I found selecting first-completion in the minibuffer to be annoying, so
> now I'm trying with the following instead (which also fixes the
> highlight to actually be shown):
>
> (defun minibuffer-cir-first-completion ()
>   "Move point to the first completion in the *Completions* window."
>   (when completion-in-region-mode
>     (with-selected-window (get-buffer-window standard-output 0)
>       (when completions-highlight-face
>         (setq-local cursor-face-highlight-nonselected-window t))
>       (first-completion))))
> (add-hook 'completion-setup-hook #'minibuffer-cir-first-completion 90)

I noticed the problem with highlighting in your previous patch too.
Although I'm not sure why 'first-completion' didn't update
the highlighting in your previous patch.  'completion-setup-function'
enables 'completions-highlight':

      ;; Maybe enable cursor completions-highlight.
      (when completions-highlight-face
        (cursor-face-highlight-mode 1))

before you called 'first-completion' at the end of 'completion-setup-function'.