From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings 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 17:07:21 +0000 Message-ID: <371ba1d0be0c526521cb@heytings.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> <83tu13vqlb.fsf@gnu.org> <371ba1d0bed233c2fbd3@heytings.org> <83pmbrvonx.fsf@gnu.org> <371ba1d0becbcd718fdb@heytings.org> <83mt6vvmxv.fsf@gnu.org> <371ba1d0be78fd6c921f@heytings.org> <83h6x3vlo7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14962"; mail-complaints-to="usenet@ciao.gmane.io" Cc: kahatlen@gmail.com, 60411@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 06 18:08:13 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 1pDqCS-0003dh-VJ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 Jan 2023 18:08:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDqCK-0000ii-Og; Fri, 06 Jan 2023 12:08:04 -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 1pDqCJ-0000iP-7v for bug-gnu-emacs@gnu.org; Fri, 06 Jan 2023 12:08: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 1pDqCI-0006JN-Qr for bug-gnu-emacs@gnu.org; Fri, 06 Jan 2023 12:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pDqCI-0002tN-FA for bug-gnu-emacs@gnu.org; Fri, 06 Jan 2023 12:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Jan 2023 17:08:02 +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.167302484511075 (code B ref 60411); Fri, 06 Jan 2023 17:08:02 +0000 Original-Received: (at 60411) by debbugs.gnu.org; 6 Jan 2023 17:07:25 +0000 Original-Received: from localhost ([127.0.0.1]:55727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDqBh-0002sZ-9Y for submit@debbugs.gnu.org; Fri, 06 Jan 2023 12:07:25 -0500 Original-Received: from heytings.org ([95.142.160.155]:33556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDqBf-0002sL-7a for 60411@debbugs.gnu.org; Fri, 06 Jan 2023 12:07:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1673024841; bh=Xg5+Q6eql3YnNVpTPt10FLj4XW6ZYQh0zgDFv55xI0w=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=7ZZIsrwNKcx0JWJq/fMZ9+dRi/3lMMP6I5OdHIyvPIMo89rOQ4xHAAdV2VlqPh+FI paljwYWlnNa2NLvPBubPJWkupTdqEqFy3sFbR3umcv0q72oRhvfycay1i/ln1EeknX ZZEeM+0RK68XwExtLZ9zvqNWlYI6P0fSbjvPhsjMjMafpoGf83bJvNGhr67vl9/wL+ AsQ0+oSSPMszyrkYxHJbLFKYmONoFtr6lBbRyoDrb0K7dnf4laDsAexcm6jhe62uSf HQoAin0fvyGk/2DmTILNkig6aTwwElCr6LzKm6guAzHO2Lym9f5CluQMYwUfehuX9V 4mIVQ4WrN18DA== In-Reply-To: <83h6x3vlo7.fsf@gnu.org> 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:252732 Archived-At: >>> Didn't you just say that the difference between "first" and "next" is >>> "the first call"? Can't we make the logic be based on that instead of >>> assuming that the format produces an empty string under certain >>> conditions? >> >> As far as I can see, no. What is also possible, if it's the condition >> that you don't like, is to insert that invisible line unconditionally, >> like this: > > If we cannot come up with any better ideas (which again surprises me), > then unconditionally adding such a newline is better. > Okay. I just had another look at this bug, and the patch below seems to work, too. I find it much trickier and adhocish, though. diff --git a/lisp/simple.el b/lisp/simple.el index 63479e9ce0..75f9956548 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -9698,6 +9698,14 @@ next-completion (let ((tabcommand (member (this-command-keys) '("\t" [backtab]))) pos) (catch 'bound + (when (and (= n 1) + (= (point) (point-min)) + (get-text-property (point) 'mouse-face) + (not (get-text-property (point) 'first-completion))) + (let ((inhibit-read-only t)) + (add-text-properties (point) (1+ (point)) '(first-completion t))) + (setq n 0)) + (while (> n 0) (setq pos (point)) ;; If in a completion, move to the end of it.