From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74523: 31.0.50; `apply` elements screw up undo in region Date: Mon, 25 Nov 2024 01:19:43 -0500 Message-ID: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3860"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca To: 74523@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 25 07:20:41 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 1tFSSf-0000mW-1U for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Nov 2024 07:20:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFSSB-0003bM-Mr; Mon, 25 Nov 2024 01:20:11 -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 1tFSS2-0003Wa-RE for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 01:20:05 -0500 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 1tFSS2-0001eH-Ho for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 01:20:02 -0500 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:From:To:Subject; bh=bV3oCNnD+o9lar7gOZgOmh4QYFJuab838RMTiBB4QnM=; b=qTzUefWyxQS6GAyJ/XygWURd26zY2AzU+oeOv0AZ+NkbPwsk4gKr9Z3aGDfFbNh6soiycyr38MkqbOBJW+zbIR2Kaw5RY4sUp+7aC4xo3oK8fJ5HOC4WmdU6U1REGKTgLFrqb2FMtzJVXMdfCTOlXw6J3w+GEBLQBDB64GyiJ+gNnp8SdTYRSRe1sIvDSJRvD2tq8AQu1vwpj1cgj5QbIWWedARVwYkXSroI6wy76huGkqnIU96s7l+eRisGPgkfau2v2ZvKD7g7ShCuYp06UOBlC7GjlWrKUp9SsdD4WtmWrKzGm5MjfS3TM+5Jb8blPCidxVzwp26Nqsz460FX5w==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFSS1-0004js-Q0; Mon, 25 Nov 2024 01:20:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: monnier@iro.umontreal.ca, bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Nov 2024 06:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74523 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: monnier@iro.umontreal.ca Original-Received: via spool by submit@debbugs.gnu.org id=B.173251559318187 (code B ref -1); Mon, 25 Nov 2024 06:20:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Nov 2024 06:19:53 +0000 Original-Received: from localhost ([127.0.0.1]:37570 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFSRs-0004jH-Mt for submit@debbugs.gnu.org; Mon, 25 Nov 2024 01:19:53 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:46978) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFSRq-0004j7-Pm for submit@debbugs.gnu.org; Mon, 25 Nov 2024 01:19:51 -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 1tFSRq-0003VA-IW for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 01:19:50 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFSRo-0001cJ-Ll for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 01:19:50 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4BFD44409F5 for ; Mon, 25 Nov 2024 01:19:45 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1732515584; bh=94VUKxvRL6yoKfiO+LKnY64IAGycH3mZh7zlH331LXo=; h=From:To:Subject:Date:From; b=jyuY4gF9GioetwDQql87LXVFxxMbpsKBvt5oKd1uxGELxY9o3cS98UfiAl2lXTEUj ipupNyHKH7Qo9ZkozLxWQ6FvztGlngPuR0RsK9iX9od4SVjc8i3SseocHAEAYgb+yc eat0liTTpbViNfwhGl+Mn6uPCH1Qq5J7G/iplVP2OPZKtNueBK4P6qJJgJX6AsIoHC 0i1iPljryNDLp4Z0KzX8keFrbh3dez+qCFjT5+ia/RrDa7da0okO/+Jc34FFJMzQUt zhfCjFBwBO6Ki6MO8RicFEzuhz1b5oKusEaGldX2jcDNw1kS6NE9r5dij2xUvp79Mw YGv4UaqcvMyXA== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 571C94401E0 for ; Mon, 25 Nov 2024 01:19:44 -0500 (EST) Original-Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3DEFF1204E2 for ; Mon, 25 Nov 2024 01:19:44 -0500 (EST) Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:295932 Archived-At: Package: Emacs Version: 31.0.50 We currently don't support `apply` undo-elements very well (if at all) in the undo-in-region feature. Those elements used to be rare, but now that `comment-region` and other users of `combine-change-calls` generate them, it's not as rare. The following test fails because of that: (ert-deftest simple-tests--undo-apply () (with-temp-buffer (modula-2-mode) ;; A simple mode with non-LF terminated comments. (buffer-enable-undo) (insert "foo\n\n") (let ((midbeg (point-marker)) (_ (insert "midmid")) (midend (point-marker))) (insert "\n\nbar") (undo-boundary) (goto-char (+ midbeg 3)) (insert "\n") (undo-boundary) (comment-region (point-min) midbeg) (undo-boundary) (comment-region midend (point-max)) (undo-boundary) (progn (goto-char midbeg) (set-mark midend) (setq last-command 'something-else) ;Not `undo', so we start a new run. (undo '(4)) (should (equal (buffer-substring midbeg midend) "midmid"))) ))) - Stefan