From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Juri Linkov <juri@linkov.net>
Newsgroups: gmane.emacs.bugs
Subject: bug#68801: 30.0.50;
 minibuffer-visible-completions=t makes RET in completion-in-region a
 no-op with nothing selected
Date: Sun, 18 Feb 2024 09:46:35 +0200
Organization: LINKOV.NET
Message-ID: <86a5nyw768.fsf@mail.linkov.net>
References: <ier4jewm0tq.fsf@igm-qws-u22796a.mail-host-address-is-not-set>
 <86y1c6688u.fsf@mail.linkov.net> <iera5om7ese.fsf@janestreet.com>
 <86plxiq6hv.fsf@mail.linkov.net> <867cjejfan.fsf@mail.linkov.net>
 <871q9k6vfo.fsf@catern.com> <867cjax4oc.fsf@mail.linkov.net>
 <87zfw6ogt2.fsf@catern.com> <iera5o01nrq.fsf@janestreet.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="12514"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)
Cc: 68801@debbugs.gnu.org, sbaugh@catern.com
To: Spencer Baugh <sbaugh@janestreet.com>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 18 08:48:07 2024
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1rbbuA-00038m-SS
	for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Feb 2024 08:48:06 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1rbbtn-0001vY-Pd; Sun, 18 Feb 2024 02:47:43 -0500
Original-Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1rbbtm-0001uz-Am
 for bug-gnu-emacs@gnu.org; Sun, 18 Feb 2024 02:47:42 -0500
Original-Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1rbbtm-0007D0-28
 for bug-gnu-emacs@gnu.org; Sun, 18 Feb 2024 02:47:42 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rbbu6-0003hr-9C
 for bug-gnu-emacs@gnu.org; Sun, 18 Feb 2024 02:48:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Juri Linkov <juri@linkov.net>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Sun, 18 Feb 2024 07:48:02 +0000
Resent-Message-ID: <handler.68801.B68801.170824246914219@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 68801
X-GNU-PR-Package: emacs
Original-Received: via spool by 68801-submit@debbugs.gnu.org id=B68801.170824246914219
 (code B ref 68801); Sun, 18 Feb 2024 07:48:02 +0000
Original-Received: (at 68801) by debbugs.gnu.org; 18 Feb 2024 07:47:49 +0000
Original-Received: from localhost ([127.0.0.1]:34116 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1rbbtt-0003hG-7L
 for submit@debbugs.gnu.org; Sun, 18 Feb 2024 02:47:49 -0500
Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:50187)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@linkov.net>) id 1rbbtq-0003gw-W2
 for 68801@debbugs.gnu.org; Sun, 18 Feb 2024 02:47:48 -0500
Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 669C3E0002;
 Sun, 18 Feb 2024 07:47:19 +0000 (UTC)
In-Reply-To: <iera5o01nrq.fsf@janestreet.com> (Spencer Baugh's message of
 "Fri, 16 Feb 2024 09:34:17 -0500")
X-GND-Sasl: juri@linkov.net
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Xref: news.gmane.io gmane.emacs.bugs:280159
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/280159>

> 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'.