From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#21523: 25.0.50; Undo with active region adds extra text Date: Wed, 18 Aug 2021 15:31:36 +0200 Message-ID: <878s0ydglj.fsf@gnus.org> References: <48592862-1630-4c61-aeed-1e3b720824de@default> <87czqdd0ng.fsf@gnus.org> <83eeat8rd5.fsf@gnu.org> <874kbpa424.fsf@gnus.org> <831r6t8i8i.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8723"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 21523@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 18 15:32:16 2021 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 1mGLfz-000232-JI for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Aug 2021 15:32:15 +0200 Original-Received: from localhost ([::1]:37074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mGLfx-00012X-MH for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Aug 2021 09:32:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mGLfm-0000xN-Ql for bug-gnu-emacs@gnu.org; Wed, 18 Aug 2021 09:32:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43714) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mGLfm-0000nS-IK for bug-gnu-emacs@gnu.org; Wed, 18 Aug 2021 09:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mGLfm-0006b6-Ah for bug-gnu-emacs@gnu.org; Wed, 18 Aug 2021 09:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Aug 2021 13:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21523 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 21523-submit@debbugs.gnu.org id=B21523.162929351525335 (code B ref 21523); Wed, 18 Aug 2021 13:32:02 +0000 Original-Received: (at 21523) by debbugs.gnu.org; 18 Aug 2021 13:31:55 +0000 Original-Received: from localhost ([127.0.0.1]:55257 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGLff-0006aY-3u for submit@debbugs.gnu.org; Wed, 18 Aug 2021 09:31:55 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:38228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGLfa-0006aJ-T8 for 21523@debbugs.gnu.org; Wed, 18 Aug 2021 09:31:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=11dV7esFL5MCW0Fdfls12W/zdXeZRTmzNPkZ3TjrsDQ=; b=ah8na6z6HlrotoZvIOHgda3xei 5ssW8WKSixlOQWwBybF6LIx9AcHc1VvOSI5ZZvUvkQPfglDM0aODA9Kp7eK/pudl8HGehUvk3jWFS /NqPlaHSoJCd/Kx4Rgp8h4KnnMWvz3Oas0JzARddFLCb6k8wESEz6Osk5ukat6eUGzzE=; Original-Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGLfN-0000OI-L4; Wed, 18 Aug 2021 15:31:41 +0200 In-Reply-To: <831r6t8i8i.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 16 Aug 2021 19:30:37 +0300") 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" Xref: news.gmane.io gmane.emacs.bugs:212137 Archived-At: Eli Zaretskii writes: > Is signaling an error okay? Yup. > Because then it looks like an off-by-one > error somewhere -- the following slightly modified recipe works as > expected: > > emacs -Q > C-u 23 M-g c ; go to "text" > M-c > C-f ; the crucial difference! > C-SPC > C-e > C-/ > => user-error: No further undo information for region > > So the problem seems to be that in the original recipe the region > starts immediately after the end of the modified portion of text. Yup; I'm seeing the same thing, so this does indeed look like a off-by-one error. And... it's in `undo-elt-in-region', I think, called by (basically) (undo-make-selective-list (mark) (point)). There's basically no test cases for this function, I think? Actually, the problem seems to be in undo-adjust-elt, which was rewritten in 2014 to fix bug#17235. I've now added a test case (commented out), but I don't quite understand the logic in undo-adjust-elt... anybody see something obviously wrong? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no