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#61535: 29.0.60; choose-completion erases in-region buffer Date: Fri, 17 Feb 2023 10:37:07 +0200 Message-ID: <83mt5c1ydo.fsf@gnu.org> References: <86y1oylrap.fsf@mail.linkov.net> <83ilg2afip.fsf@gnu.org> <86edqpebxy.fsf@mail.linkov.net> <83bklt2wz6.fsf@gnu.org> <86bklsem93.fsf@mail.linkov.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9105"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61535@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 17 09:38:25 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 1pSwG9-0002E7-4d for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 17 Feb 2023 09:38:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSwFo-0007lH-L0; Fri, 17 Feb 2023 03:38: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 1pSwFm-0007kt-Du for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2023 03:38:02 -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 1pSwFl-0001jg-Nh for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2023 03:38:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pSwFl-00073g-KB for bug-gnu-emacs@gnu.org; Fri, 17 Feb 2023 03:38: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, 17 Feb 2023 08:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61535 X-GNU-PR-Package: emacs Original-Received: via spool by 61535-submit@debbugs.gnu.org id=B61535.167662303727082 (code B ref 61535); Fri, 17 Feb 2023 08:38:01 +0000 Original-Received: (at 61535) by debbugs.gnu.org; 17 Feb 2023 08:37:17 +0000 Original-Received: from localhost ([127.0.0.1]:38436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSwF2-00072k-L8 for submit@debbugs.gnu.org; Fri, 17 Feb 2023 03:37:16 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pSwF0-00072T-OC for 61535@debbugs.gnu.org; Fri, 17 Feb 2023 03:37:15 -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 1pSwEu-0001XL-It; Fri, 17 Feb 2023 03:37:08 -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=xP63MB7bM9uMaUxXBALeT5d6HJuUNKz5knkGCkA/fL0=; b=a77BiSb+5NtF CZs14OyIvOxxhzCvCVmxZfTUXR7pxk55u4QQ2eWXK73PMyZGdwUDRGHVjGrc+cFuGyJiZIVKGGcL/ rQ82xMJL+PeNEDrm0hpo+EXzpgGlEF+QzHGSK4bY8XRg7N0PTo+xDN+npUTEfAG5B3uk7KzsZZrUr NxAiIOq4AM7R2VPEPTI2sTDV2Guno7b1gXS/Oc3Jaxl7P5fBbs6Zj9SBteG0kUdjVjB9tFX3Uk5xJ 3vQyrIObNmMWSzIqiU9dnGMA8UV9eg+YcVTPsCUCrt234aLO/gK2J5Oik6ikFSyNmezLGgdUqK8BB Mf7DG9Q6yhEoWHq4HmGf0g==; 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 1pSwEt-0006Mk-L5; Fri, 17 Feb 2023 03:37:07 -0500 In-Reply-To: <86bklsem93.fsf@mail.linkov.net> (message from Juri Linkov on Fri, 17 Feb 2023 09:50:40 +0200) 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:255865 Archived-At: > From: Juri Linkov > Cc: 61535@debbugs.gnu.org > Date: Fri, 17 Feb 2023 09:50:40 +0200 > > >> >> 1. type: (with-c C-M-i > >> >> 2. type: M-down ... M-RET > >> >> 3. check that the whole buffer was deleted before a selected > >> >> completion candidate was inserted to the buffer: > >> >> C-h v buffer-undo-list RET > >> > > >> > Which buffer was deleted? *scratch*? It isn't here. > >> > > >> > And what does "C-h v buffer-undo-list RET" mean? > >> > > >> > Bottom line: I don't understand what is the bug here and/or how to > >> > reproduce it. > >> > >> The contents of the *scratch* buffer is erased and replaced > >> with the same text. This fact can be confirmed by looking > >> at the value of 'buffer-undo-list' that contains the text > >> of the whole buffer as a string. Especially this is noticeable > >> when using in-region completion in a large buffer. > >> > >> With the patch, only the completed string is inserted. > > > > Thanks for the explanation. Then please install this on master, since > > AFAIU this is a very old problem, and it's just an aesthetic one. > > Actually, this is not an old problem. It's in a new feature added in 29.1. Hmmm... I don't think I see that. Both completion-in-region-mode and the condition at that place haven't changed in a while. The addition of completion-use-base-affixes part is new, but since it's via 'and', it cannot have changed what the code before did, only cause it to do that in fewer cases. What am I missing? > And this patch fixes the new feature. This is different from a similar > problem fixed now in bug#61479 that is really an old problem. This is all undecipherable for me, sorry. What is that "new feature", and how is it fixed here? And how is bug#61479 relevant?