From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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: Sun, 01 Jan 2023 12:55:22 -0500 Message-ID: References: <87zgb5lx6y.fsf@oracle.com> <6c9d91cffcdbff97f034@heytings.org> <87lemot7ek.fsf@gmail.com> <0a62cbaeff1ee0497715@heytings.org> <226b32f79f7db2be1bbe@heytings.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3840"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Knut Anders Hatlen , 60411@debbugs.gnu.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 01 18:56:15 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 1pC2ZC-0000l8-U7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 01 Jan 2023 18:56:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pC2Z1-0003MX-UL; Sun, 01 Jan 2023 12:56:03 -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 1pC2Z0-0003ME-BJ for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2023 12:56:02 -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 1pC2Z0-0007vZ-3L for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2023 12:56:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pC2Yz-0004nC-Ub for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2023 12:56:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Jan 2023 17:56:01 +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.167259573818386 (code B ref 60411); Sun, 01 Jan 2023 17:56:01 +0000 Original-Received: (at 60411) by debbugs.gnu.org; 1 Jan 2023 17:55:38 +0000 Original-Received: from localhost ([127.0.0.1]:41671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC2Yb-0004mU-MZ for submit@debbugs.gnu.org; Sun, 01 Jan 2023 12:55:37 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:28194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC2YZ-0004mG-Ld for 60411@debbugs.gnu.org; Sun, 01 Jan 2023 12:55:36 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DB744441347; Sun, 1 Jan 2023 12:55:29 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1708B44133F; Sun, 1 Jan 2023 12:55:24 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1672595724; bh=WRX07NVNutL+MtHlPxudjtxrSqoW2WxG+p+5JH7O4mA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=aORY89OhW4OaxmoqfmHQZL8yS67C9CpqRLlUrDGOx9ETPecuqhXKQ+3xTfQehLX2z WI2qf+3gqVorqbrRQx3hDH41IjEuCjqkSRXnacRb2RnuTfkXEBa0sM2e5mmem+VPjZ HHMN21cg7db/ouEIou5YPv/JvfeaoctMzvp+bOEe7hgEaxINcIZ2m0tawvtWRDqIIY 2TM1LJmHEbf8FDVM+6KexuRx9mUHAux2Chxle5RB7GCEry7FhenWnxCqU1T0OrpK3J HtiBlDDPnPo/5Wb79RcU8TwLvHpHuG1DbqQnRfj7EmwzJF6yyQc1w0RI3hDmlb9E+U 4nRAXet2Nfs5w== Original-Received: from pastel (unknown [45.72.200.228]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C21591201D0; Sun, 1 Jan 2023 12:55:23 -0500 (EST) In-Reply-To: <226b32f79f7db2be1bbe@heytings.org> (Gregory Heytings's message of "Sun, 01 Jan 2023 17:05:18 +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:252263 Archived-At: >> Yuck. I get the impression that it would be cleaner to fix "the first >> call to `minibuffer-next-completion`" instead. > That was my impression, too. Until I tried to fix "the first call to > `minibuffer-next-completion`". But I may have missed something, of course. Hmm... 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?). This is made more muddy by (when completions-highlight-face (setq-local cursor-face-highlight-nonselected-window t)) which changes the behavior of *Completions* depending on whether `minibuffer-next-completion` has been used or not since the *Completions* buffer was setup. [ "Fixing" this might require extending `cursor-face-highlight-nonselected-window` so that it can indicate whether to highlight when either *Completion* or the minibuffer is selected). ] 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. Stefan