From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii 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: Fri, 06 Jan 2023 13:40:16 +0200 Message-ID: <83tu13vqlb.fsf@gnu.org> References: <87zgb5lx6y.fsf@oracle.com> <6c9d91cffcdbff97f034@heytings.org> <87lemot7ek.fsf@gmail.com> <0a62cbaeff1ee0497715@heytings.org> <226b32f79f7db2be1bbe@heytings.org> <226b32f79f65b964c636@heytings.org> <86sfgp5ihl.fsf@mail.linkov.net> <8dea9f3e0e993e0bd0a9@heytings.org> <83a62ww4bo.fsf@gnu.org> <371ba1d0be9671d4a3a4@heytings.org> <83v8lkujt0.fsf@gnu.org> <371ba1d0be87d64ed419@heytings.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24221"; mail-complaints-to="usenet@ciao.gmane.io" Cc: kahatlen@gmail.com, 60411@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 06 12:41:32 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 1pDl6J-00068j-Fi for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 Jan 2023 12:41:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDl5v-0003jd-I7; Fri, 06 Jan 2023 06:41: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 1pDl5q-0003j0-5S for bug-gnu-emacs@gnu.org; Fri, 06 Jan 2023 06:41: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 1pDl5p-0002O1-Tk for bug-gnu-emacs@gnu.org; Fri, 06 Jan 2023 06:41:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pDl5p-0003wv-KO for bug-gnu-emacs@gnu.org; Fri, 06 Jan 2023 06:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Jan 2023 11:41: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.167300521015101 (code B ref 60411); Fri, 06 Jan 2023 11:41:01 +0000 Original-Received: (at 60411) by debbugs.gnu.org; 6 Jan 2023 11:40:10 +0000 Original-Received: from localhost ([127.0.0.1]:53893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDl4z-0003vV-N2 for submit@debbugs.gnu.org; Fri, 06 Jan 2023 06:40:10 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDl4x-0003vD-7E for 60411@debbugs.gnu.org; Fri, 06 Jan 2023 06:40:08 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDl4q-0001C9-Q9; Fri, 06 Jan 2023 06:40:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ATlhkQpDeCHCfmqSZSe58CoibV56xlNCGweE+Rjw1Lg=; b=ElgGYnPMRWlw kpd+P6Z7Yirxu8ldmW/u9STyXqY6ExHUJuTwpdnuvSVpFFy09s1FFi+mfBPrsoFV5IizBt1Kl5GzP 5pALlfsyux2Xku7qobdNmS00+6Hg3JOFgK8yIOo49Ps8srBoxRq/7d9iHXUfSgc8T/ZQRKPzEzpXb RRqZPNUzzWYDVgNEJf85gEfN27fnsSrL3T7B5o5Un0ldmJt21meWTNCkF2vmDbAW4a2w35l8Ri9g+ r388eXYETYjUjTdIu3latBdJFleK0B4j74jhHa6tNL0ravOmNP5aHz95JPYzH+r4tLfGnE/mgxFg3 AnmLuaz21vR/vquxHWbAQw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDl4q-0007TX-Ak; Fri, 06 Jan 2023 06:40:00 -0500 In-Reply-To: <371ba1d0be87d64ed419@heytings.org> (message from Gregory Heytings on Fri, 06 Jan 2023 09:01:08 +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:252693 Archived-At: > Date: Fri, 06 Jan 2023 09:01:08 +0000 > From: Gregory Heytings > cc: kahatlen@gmail.com, 60411@debbugs.gnu.org, monnier@iro.umontreal.ca, > juri@linkov.net > > > >>>> Stefan and Eli, do you agree with that conclusion? > >>> > >>> I admit that I've lost the line of reasoning here (too much of the > >>> previous context is being elided, forcing me to re-read the entire > >>> discussion). Which code is proposed for the release branch, and how > >>> will Emacs behave with that code in this particular use case? > >> > >> It's this patch. It adds an invisible empty line at the beginning of > >> *Completions* when completions-header-format is not a string (in > >> particular, nil) or an empty string. > > > > What is the significance of these two special values of > > completions-header-format? Is it that you want to test whether the > > first candidates starts at buffer position 1 in the *Completions* > > buffer? Then why not test for that explicitly? > > > > When completions-header-format is nil or an empty string, no completion > header "NNN possible completions:\n" is inserted in *Completions*. > Because of this, minibuffer-next-completion (bound to M- by > default), which is supposed to select the first completion when it is > called for the first time, erroneously selects the second completion. > The fact that "something" (the completion header and/or the help text > "Click on a completion to select it...") must exist in *Completions* > before the first completion candidate is more or less hardcoded in the > logic of minibuffer-next-completion. Then why not change that logic in minibuffer-next-completion to be smarter about this? What you suggest is too ad-hoc-ish, and any future change to the possible values of completions-header-format will risk breaking the condition you propose. Or maybe what minibuffer-next-completion does should be rethought? Why does it assume that the first candidate is on the second line? what if it's on the third line instead?