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#70968: 29.2.50; choose-completion on an emacs22-style completion deletes text after point Date: Sat, 14 Sep 2024 12:17:04 +0300 Message-ID: <86o74qh9wv.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34766"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, 70968@debbugs.gnu.org, monnier@iro.umontreal.ca, juri@linkov.net To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 14 11:17:59 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 1spOul-0008vc-6Z for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Sep 2024 11:17:59 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1spOug-0008Vd-Pg; Sat, 14 Sep 2024 05:17:54 -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 1spOue-0008MX-Gb for bug-gnu-emacs@gnu.org; Sat, 14 Sep 2024 05:17:52 -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 1spOue-0004DA-7R for bug-gnu-emacs@gnu.org; Sat, 14 Sep 2024 05:17:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=s3uH1hLDbU1J9ZqgMCBwBQWi6LECLdiMX/OCgaTEflM=; b=lveg14v6qwsCBHroTllspdborb2Ywu7iRptp7tBBrv3YX0O4wNZs8HW0HfToEo6FvWfttW8sCT8NAZE/cLpbEdH6ycRj5b0cdWQKhWnKHeVBjJtRF1FCtIaIByivNtscnglW9KZ1a30SeimtpJ8txhB42h+690/IRFcq5APDEdRdfuiA95TOqZYbtywDO1AwpBYYmrToCNJlfZ6QDljd0kyqy8mL+h09z8fm3jhF9uuIKVcFkpCibi5S/8PEA9/VClW5QSFPslA9zTRbYtn7zcWggD8PZhtJ+hQO+j4mQ9XlM2mAhyXGaKXdyTEMzA7ae44vaHLJkAXxjYT5xuXEeg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1spOuo-00006W-Eu for bug-gnu-emacs@gnu.org; Sat, 14 Sep 2024 05:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Sep 2024 09:18:02 +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.1726305448338 (code B ref 70968); Sat, 14 Sep 2024 09:18:02 +0000 Original-Received: (at 70968) by debbugs.gnu.org; 14 Sep 2024 09:17:28 +0000 Original-Received: from localhost ([127.0.0.1]:44799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spOuG-00005N-6k for submit@debbugs.gnu.org; Sat, 14 Sep 2024 05:17:28 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:57174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spOuE-000050-NC for 70968@debbugs.gnu.org; Sat, 14 Sep 2024 05:17:27 -0400 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 1spOtw-0004BR-S1; Sat, 14 Sep 2024 05:17:09 -0400 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=s3uH1hLDbU1J9ZqgMCBwBQWi6LECLdiMX/OCgaTEflM=; b=cL0sm1llMzrj t1hZJ8udaKeNcV/kptmwW6jWlcxQ+m1fYn6a8Vo7JV2+lXaXoSeWy4rXqg9fPz4uYUOkfN1eXnQGj AjO0bYwN5q/nOP2vDbKHkg5Jf3abBQ/ShzS1gRLxX0KIxnSJ5HqyX5tbZgdJ/5uANqmKk39KRxM5X 7r9GHLNq+DhS9lITAbnz4pjC5MMteN3in39/cWJNnZkuAn4/qrrvvzCf7A6BszW96p+cGwSanTF2S AoSFsuxlSPfXeNukIkXnSy41rdefBoSGYK7g8ga/bcIDi4z2zqa9wvGBLHqttQRGJKPuZjmgjHWUK iJ282ZPw+esenjVQuZ3IyQ==; In-Reply-To: (message from Spencer Baugh on Tue, 10 Sep 2024 12:54:05 -0400) 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:291715 Archived-At: > From: Spencer Baugh > Cc: Eli Zaretskii , juri@linkov.net, 70968@debbugs.gnu.org, > Dmitry Gutov > Date: Tue, 10 Sep 2024 12:54:05 -0400 > > 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. Option C is from my POV the least desirable one: it adds some complicated logic, which will almost certainly produce unintended results, as everything in this completion-related mess we have. I'm okay with adding a new style, per B, but why do we need to deprecate emacs22 at the same time? Let users who want this new behavior customize their completion styles to use this new style instead of emacs22. That'd be fully backward compatible, and will solve the problem for those who don't like the current behavior.