From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#48356: 28.0.50; choose-completion discards the suffix after the completion boundary Date: Thu, 18 Apr 2024 10:25:01 -0400 Message-ID: References: <18593691-8b7a-facf-68e1-e9d0c106897b@daniel-mendler.de> <868rtcjqk4.fsf@mail.linkov.net> <949a6c3a-9a59-89dd-bdee-c0ec6ee0baa7@daniel-mendler.de> <86r173odnm.fsf@mail.linkov.net> <868rt42wiz.fsf@mail.linkov.net> <39326c56-094c-4074-95d7-8f92f7f927a5@gutov.dev> <82196eff-85e6-44da-89e4-4ead4d72e657@gutov.dev> <5f353cfe-b2d7-43ab-bc65-37a0d306c042@gutov.dev> <865xwov165.fsf@gnu.org> <3833acf2-704e-486b-8e33-54cddf26adc9@gutov.dev> <86le5f99ml.fsf@mail.linkov.net> <11a8e438-128d-47b3-ae6f-c3ce48bb902b@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35551"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: mail@daniel-mendler.de, Juri Linkov , 48356@debbugs.gnu.org, monnier@iro.umontreal.ca, jdtsmith@gmail.com, Visuwesh , Eli Zaretskii To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 18 16:26:04 2024 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 1rxSiC-0008xc-BZ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 Apr 2024 16:26:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxSi1-0002lh-U2; Thu, 18 Apr 2024 10:25:53 -0400 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 1rxShz-0002lF-Fn for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2024 10:25:51 -0400 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 ) id 1rxShy-00025o-RJ for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2024 10:25:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rxSiC-0006FO-63 for bug-gnu-emacs@gnu.org; Thu, 18 Apr 2024 10:26:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Apr 2024 14:26:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48356 X-GNU-PR-Package: emacs Original-Received: via spool by 48356-submit@debbugs.gnu.org id=B48356.171345032423656 (code B ref 48356); Thu, 18 Apr 2024 14:26:03 +0000 Original-Received: (at 48356) by debbugs.gnu.org; 18 Apr 2024 14:25:24 +0000 Original-Received: from localhost ([127.0.0.1]:52736 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxShX-00069U-KJ for submit@debbugs.gnu.org; Thu, 18 Apr 2024 10:25:24 -0400 Original-Received: from mxout6.mail.janestreet.com ([64.215.233.21]:53589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxShU-00068S-Of for 48356@debbugs.gnu.org; Thu, 18 Apr 2024 10:25:22 -0400 In-Reply-To: <11a8e438-128d-47b3-ae6f-c3ce48bb902b@gutov.dev> (Dmitry Gutov's message of "Mon, 15 Apr 2024 02:55:35 +0300") DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1713450301; bh=KP6nZwYnfpWc32No/Clh68EuUsYF8SwdnebKP50WmsA=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=lZqxMsgEb1xs9ZuCoklrB53v2Er3+/YS94gw/a6ofi3tPWnCxbvotuoS0/pFaxA2u tKorXlarqQVvTjUusXUGg5FYGTCaGDPmQqebzCP5OG+2RW3IpNTgEDJUlKfwxgnOKk LxKVOfLA8DCbgTM0j3qT4Pf3jeY3BuAxm5b5ynamfOh03F3sxnrsRG9VOW6i06VzDW dKl9gzUtzUJLq8kaOGR2bBgSehA/eEDqY8WTzNg6fhL7bPyn/GAent++CHCqSUo89o lyqCkug5da4rmr/kNL7DEUSAff5tZSjiLxG3SXUp1n9LnMqq0y8+i8LjLgAsztNXDa gAGJEtOcEyPhg== 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:283567 Archived-At: Dmitry Gutov writes: > Hi Juri, > > On 14/04/2024 19:44, Juri Linkov wrote: >>> As one downside, it brings back behavior described in >>> https://debbugs.gnu.org/34517#14. That doesn't seem too critical to me, but >>> opinions might vary. >> Sadly, this is quite an important case. Recently Spencer implemented >> a way to deselect a candidate in the visible completions list >> (minibuffer-visible-completions=t) when the user starts typing >> in the minibuffer. > > I think the (admittedly pretty cool) minibuffer-visible-completions > feature is orthogonal: the scenarios I'm considering and trying to fix > here also involve selecting a completion from *Completions* in some > way (e.g. using M-up or M-down followed by M-RET, in default > configuration). And this is currently working worse for in-buffer > completion than for minibuffer completion WRT keeping the suffix > around. Yes, e.g.: 1. emacs -Q 2. M-x shell 3. mkdir -p dir1 dir2 && touch dir1/foo dir2/foo 4. cat dir/foo TAB 5. *Completions* contains: 2 possible completions: dir1/ dir2/ 6. Click "dir1/" 7. The buffer now contains "cat dir1/", the "foo" has been deleted This is a bug, but moreover it's also inconsistent with minibuffer completion, e.g.: 8. C-x C-f dir/foo TAB 9. *Completions* contains: 2 possible completions: dir1/ dir2/ 10. Click "dir1/" 11. The minibuffer now contains "dir1/foo" We should make them both behave the same way. >> But then the user could change the mind >> and still select a candidate. This would interfere with the >> contents of the minibuffer. > > Suppose they do. But the list of completions they're shown is for an > outdated input. Does it really make more sense to erase the current > input than to insert the completion where it was supposed to go? Yeah, this patch changes the behavior in the case of an outdated *Completions* buffer, and the new behavior is buggy, but I think the old behavior was also buggy and the new behavior is better. Example: In emacs -Q, if I type C-x C-f ~/src/emacs/emacs-2 I get completions "emacs-28" and "emacs-29" Suppose I then type /src (without hitting tab or updating the *Completions* buffer) so that the minibuffer contains: ~/src/emacs/emacs-2/src Then I click on one of the completions to choose it. Before this patch the minibuffer will contain: ~/src/emacs/emacs-28/ and after this patch it will contain ~/src/emacs/emacs-28//src Both of these are wrong IMO, but IMO the second one is closer to correct, and it's more consistent with the normal case (when *Completions* is up to date) and with in-buffer completion behavior, so I think this patch is an improvement and could be installed. Still, maybe we can get it to the point where clicking on an outdated completion makes the minibuffer contain ~/src/emacs/emacs-28/src instead? Which I think is the correct behavior. But I don't think we need to do that before landing this patch.