From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#60411: 29.0.60; minibuffer-next-completion skips first candidate when completions-header-format and completion-show-help are nil Date: Thu, 05 Jan 2023 19:37:34 +0200 Organization: LINKOV.NET Message-ID: <86sfgp5ihl.fsf@mail.linkov.net> References: <87zgb5lx6y.fsf@oracle.com> <6c9d91cffcdbff97f034@heytings.org> <87lemot7ek.fsf@gmail.com> <0a62cbaeff1ee0497715@heytings.org> <226b32f79f7db2be1bbe@heytings.org> <226b32f79f65b964c636@heytings.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36179"; 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: Knut Anders Hatlen , 60411@debbugs.gnu.org, Stefan Monnier To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 05 18:57:44 2023 Return-path: 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 ) id 1pDUUq-0009GJ-9z for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Jan 2023 18:57:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDUUF-0002Sg-5h; Thu, 05 Jan 2023 12:57:07 -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 ) id 1pDUUB-0002Qi-Sr for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 12:57:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDUUB-0005VG-LL for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 12:57:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pDUUB-0008E8-Hf for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 12:57:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Jan 2023 17:57:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60411 X-GNU-PR-Package: emacs Original-Received: via spool by 60411-submit@debbugs.gnu.org id=B60411.167294137231477 (code B ref 60411); Thu, 05 Jan 2023 17:57:03 +0000 Original-Received: (at 60411) by debbugs.gnu.org; 5 Jan 2023 17:56:12 +0000 Original-Received: from localhost ([127.0.0.1]:52805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDUTL-0008Bd-PB for submit@debbugs.gnu.org; Thu, 05 Jan 2023 12:56:12 -0500 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:59249) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDUTK-0008B7-4Q for 60411@debbugs.gnu.org; Thu, 05 Jan 2023 12:56:10 -0500 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 3E4402000A; Thu, 5 Jan 2023 17:56:00 +0000 (UTC) In-Reply-To: <226b32f79f65b964c636@heytings.org> (Gregory Heytings's message of "Sun, 01 Jan 2023 18:56:30 +0000") 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" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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:252617 Archived-At: >> I think the crux of the matter is that the state in which we are at the >> beginning (when creating the *Completions* buffer) is unclear/accidental >> (is the first completion already selected or not?). > > Exactly. > >> It's not clear to me how to "make this right", but maybe a "better ugly >> hack" is to work with the above `setq-local`, i.e. if >> `cursor-face-highlight-nonselected-window` is still nil (in which case, >> the cursor-face hilighting should be currently off), consider that >> `minibuffer-next-completion` should move to the *first* completion rather >> than to the next. > > I thought about that solution, but what if someone sets > completion-highlight-face to nil? I also tried to add another buffer-local > variable to distinguish the first and later calls to > minibuffer-next-completion, but that didn't work in all cases either. Then I guess your insert-invisible-\n patch is the simplest way to enforce such a long-standing rule that no candidate is selected in the completions buffer initially, even when it has no visible header. And definitely this is the safest solution for the release branch.