From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#60467: 30.0.50; primitive-undo: Changes to be undone by function different from announced Date: Tue, 03 Jan 2023 13:44:01 +0000 Message-ID: References: <87o7ri74qv.fsf@localhost> <9bc9c69ac20a37ded741@heytings.org> <9bc9c69ac282c0148962@heytings.org> <87h6x9mgdv.fsf@localhost> <838rij23by.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="XIbtaRmN05" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8480"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60467@debbugs.gnu.org, yantar92@posteo.net, Stefan Monnier To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 03 14:45:18 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 1pChbR-0001tU-PR for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Jan 2023 14:45:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pChbE-0003Mg-PI; Tue, 03 Jan 2023 08:45: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 1pChbC-0003MV-VH for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2023 08:45:03 -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 1pChbC-0007tt-Li for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2023 08:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pChbC-000626-EC for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2023 08:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Jan 2023 13:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60467 X-GNU-PR-Package: emacs Original-Received: via spool by 60467-submit@debbugs.gnu.org id=B60467.167275344523103 (code B ref 60467); Tue, 03 Jan 2023 13:45:02 +0000 Original-Received: (at 60467) by debbugs.gnu.org; 3 Jan 2023 13:44:05 +0000 Original-Received: from localhost ([127.0.0.1]:44970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pChaG-00060Z-TT for submit@debbugs.gnu.org; Tue, 03 Jan 2023 08:44:05 -0500 Original-Received: from heytings.org ([95.142.160.155]:57142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pChaE-00060F-VW for 60467@debbugs.gnu.org; Tue, 03 Jan 2023 08:44:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1672753441; bh=cfB3oSmkoYZVINDbhj7DkdzondQObd6o5yXXNJdjfOg=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=Dy9rKvcIsnMrTuLbVFBzQi6eMNxnocrfRF2YEXEpkEPO/ELZUvIIClUX9FTAV4xpE tTAZ60TTBHe/keBKEu80waEobq5VgTPGl8O9YiOFz3Ekkmeqel1XkilT4tOFd77xnf xvKG8eSqB6MbQ+GFKO3Nsn6PmsrPct1vIvgdeUjwDczTCkykulMfxep6H9zGtdx3gD WpeJ/b9fY/3f2bWYLkbvB8NSGuzZsC01tHhjQBgcfRRhDyJBcgX+A2mc7+gNPwMPx9 GFggEX+c/toCEDGbm9E5FEKE6P5Le+/8ziL9pU7lH2QsKMoQy45UxkJKkoIWl58o8d EUMlnPSJbtnTQ== In-Reply-To: <838rij23by.fsf@gnu.org> 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:252402 Archived-At: --XIbtaRmN05 Content-Type: text/plain; format=flowed; charset=us-ascii >> Patch attached. > > Hmm... scary, even if this is intended for the master branch. Could you > at least keep the few comments which were in the original code, and > perhaps also add comments explaining all those tricky tests with consp, > equality to t and to old-bul, the significance of (car ptr) and (caar > ptr), etc.? This would make the code more maintainer-friendly, as the > need to constantly consult the spec of the various undo-list elements > (and hope the spec is complete and accurate ;-) would be avoided. > Is the attached patch better in that respect? > > I'd prefer to fix this in Emacs 29 if feasible, but unless the changes > are much simpler and/or more clearly documented, so that it becomes > possible to assess their risks, I don't see how that could happen. > I don't see how the changes could be made simpler, sorry, but now they are documented. Feel free to ask further questions if something is still unclear. > > I presume that all the undo tests we have still pass? > They do. > > If so, how about adding a test for this bug? > I'll see if I can do that, but it seems tricky. --XIbtaRmN05 Content-Type: text/x-diff; name=Fix-combine-change-call.patch Content-Transfer-Encoding: base64 Content-ID: Content-Disposition: attachment; filename=Fix-combine-change-call.patch RnJvbSA4ZjY1YTc0ZWMxYjg2YjNmNWYyOTU5NzJjOTliMGI0NjFjYzdiZDI4 IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJ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