From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70968: 29.2.50; choose-completion on an emacs22-style completion deletes text after point Date: Tue, 10 Sep 2024 12:54:05 -0400 Message-ID: References: <86bk56jhsp.fsf@gnu.org> <377f815c-52d2-4770-ae85-55e096e104b0@gutov.dev> <8634qhipgj.fsf@gnu.org> <7e05fd14-3499-4811-b4bc-b53186b15408@gutov.dev> <86ed5vzzru.fsf@gnu.org> Reply-To: Spencer Baugh Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40497"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Dmitry Gutov , Eli Zaretskii , 70968@debbugs.gnu.org, juri@linkov.net To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 10 18:55:15 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 1so494-000ANC-W5 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 10 Sep 2024 18:55:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so48q-0007B5-7s; Tue, 10 Sep 2024 12:55:00 -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 1so48n-000724-RW for bug-gnu-emacs@gnu.org; Tue, 10 Sep 2024 12:54:57 -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 1so48m-0008GR-WF for bug-gnu-emacs@gnu.org; Tue, 10 Sep 2024 12:54:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=eTHrNf8WttcBKgJdJp3ZhmCB8E0xdrX19I5Yfz8xi18=; b=v07/uGTvS7Zuq/0t2JKPwLZpD0t9xDXH9qZTodFUzarBb2eRDoxpP1YDukYCwDhgDyS/EfaI6DTtkjDGgn1x+KGiU1FJ/NTisBLYWybGPpD++xn/E9D81B9arHDNtYICp6jzNXkmYPu4mgzC2a91q4yfH6EwgK/Svg08yuEek+4lkxCTf/bxbF/Me38YPRaZInqCejXwjeimXtagCpzpw4WWbUQzPyanyOzdaBCzxNfwQmKWAJeA6blwc83UFenB/woRULpiZG35UpnsOLYeNr0sPqrIdmWTkZ2dRlWZTGk0XGg/FSVLvNV/zEZNsGEVX7CB8zTi3xZjuQ9azrRcOQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1so48r-0006ZY-U9 for bug-gnu-emacs@gnu.org; Tue, 10 Sep 2024 12:55:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Sep 2024 16:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70968 X-GNU-PR-Package: emacs Original-Received: via spool by 70968-submit@debbugs.gnu.org id=B70968.172598725825193 (code B ref 70968); Tue, 10 Sep 2024 16:55:01 +0000 Original-Received: (at 70968) by debbugs.gnu.org; 10 Sep 2024 16:54:18 +0000 Original-Received: from localhost ([127.0.0.1]:36909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1so48A-0006YG-5E for submit@debbugs.gnu.org; Tue, 10 Sep 2024 12:54:18 -0400 Original-Received: from mxout2.mail.janestreet.com ([38.105.200.79]:48925) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1so487-0006Y0-SJ for 70968@debbugs.gnu.org; Tue, 10 Sep 2024 12:54:16 -0400 In-Reply-To: (Stefan Monnier's message of "Sun, 08 Sep 2024 07:12:47 -0400") DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1725987245; bh=eTHrNf8WttcBKgJdJp3ZhmCB8E0xdrX19I5Yfz8xi18=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=skuI8Gvahg00vdAuFtzyMounXyPfSEJGUjDEwNUol94WPQZY9p2SO2kBREEHK06n4 AtN/qBt7dUN924PI6fnWvUw7IFi5f0uBCU5W0O45KxDqrFefeyKwiM+rTScdR/aWBU jv8T75vOJSZNVecRDMGZV20GR72x845UJAFrNHDOpMHpKCFX11xCO/lR1NQlBoR6rR dKSKRqFkl4bs4lRxIsDs2VLiWQflVhsW1fvd3SF3G/Q9hHR4HcspkLDWyF8bz5NsUy 1jZwC3OuvGJ+o3F2HRc4Gc69LIJxtZGyyoMMIHm6NbeZy1MicZrk+LR3326cd7uScR iabLge3UjXYZw== 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:291572 Archived-At: Stefan Monnier writes: >> Ping! How should we proceed with this bug report? > > I don't quite understand the question. > > After: > > Eli wrote: >> Stefan wrote: >> > I'm not sure it's terribly important to preserve this detail of the >> > behavior of `Emacs-22`. The `emacs22` style does not aim to provide the >> > illusion you're running an old Emacs. I named it that way because >> > I couldn't come up with a good descriptive name for it. If it >> > misbehaves, I don't see a need to be bug-compatible, especially since >> > this doesn't affect ELisp code but users. >> >> I think it does, sorry. Suchj old behavior is a de-facto standard. >> If we change that, we should at least have a knob to get back the old >> behavior. > > I thought you had decided that the current behavior is not a bug. > I'm fine with this choice and we can close it as such. > Tho maybe we'd want to deprecate that `emacs22` style because of > those odd cases. I definitely don't want to just close this bug. I often get user complaints about this behavior. In my experience, for novice users, it's a fairly significant inconsistency in the default Emacs completion experience. I see a few good ways to fix this in a backwards-compatible way: A. Fix it in emacs22 with a defcustom to get back the old behavior. B. Deprecate the emacs22 style and replace it with a new style called `ignore-suffix` which has this bug fixed, and which replaces emacs22 in the default value of completion-styles. C. Follow this idea I suggested earlier: Currently emacs22 is the only style that ignores the text after point when completing. But, this is often useful behavior, and I'd like to support it in other completion styles. Specifically, I think it would be nice if completion always: 1. First, run the completion styles on the literal text in the completion region or minibuffer. 2. If that returned nil, run the completion styles again, but without the text after point in the region or minibuffer. Step 2 when run with the basic style is equivalent to the emacs22 style. So, emacs22 could be removed from the default completion-styles, since a completion-styles of '(basic) would be equivalent to '(basic emacs22). I think this would make it straightforward to then fix choose-completion to behave correctly when the completion was generated through step 2. I personally like the option C best, because I already want to do this generalization, so that the ignore-suffix behavior also works for other completion styles (e.g. partial-completion or substring). But I would like to get some feedback on this idea from others first.