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: Wed, 04 Jan 2023 00:16:39 +0000 Message-ID: References: <87o7ri74qv.fsf@localhost> <9bc9c69ac20a37ded741@heytings.org> <9bc9c69ac282c0148962@heytings.org> <87h6x9mgdv.fsf@localhost> <838rij23by.fsf@gnu.org> <83zgazznau.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33607"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60467@debbugs.gnu.org, Alan Mackenzie , Eli Zaretskii , yantar92@posteo.net To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 04 01:17:19 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 1pCrT3-0008UK-VS for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 04 Jan 2023 01:17:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCrSq-0003Zz-34; Tue, 03 Jan 2023 19:17: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 1pCrSo-0003Zr-Lx for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2023 19:17: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 1pCrSo-000459-Cx for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2023 19:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pCrSn-00079S-W9 for bug-gnu-emacs@gnu.org; Tue, 03 Jan 2023 19:17: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: Wed, 04 Jan 2023 00:17:01 +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.167279140727467 (code B ref 60467); Wed, 04 Jan 2023 00:17:01 +0000 Original-Received: (at 60467) by debbugs.gnu.org; 4 Jan 2023 00:16:47 +0000 Original-Received: from localhost ([127.0.0.1]:47103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCrSZ-00078x-7L for submit@debbugs.gnu.org; Tue, 03 Jan 2023 19:16:47 -0500 Original-Received: from heytings.org ([95.142.160.155]:57780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCrST-00078k-DN for 60467@debbugs.gnu.org; Tue, 03 Jan 2023 19:16:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1672791400; bh=Tiypbv4qHhgWwU6v0sHLPlGRnstKQxoJKIQfjhic+QM=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=RRH+o87rToZjrQiUmMQKWpqcZv04WDJksLzV94YjjNOzS5dvdPeaCE+2hjA7MY40w cnJysDdBC0FDqc1g8MMO+0iD+PhgadEoaPq/2Pg4sURLyeXn1HO4hfAfIzqnMp4Lb3 eF9n1sO89zivjKwl+bJgDeWdEtdcZwLYb1nzkEkpS0LxD1TW+oJU232AvHeUcf/M14 gCQvUNddK0u3rHF5tsKECB7IwKEO8eV4rqgAjb1V7uLLCUfLDEAIq23Hlh3lu4aq+t bL32C15+1TSxc2N9aY8GLhR9Y/mdSOj+H+7si9zqZeuruNjgBABd1PMGajuotXaflk Gm/4gVRPGAWaQ== In-Reply-To: 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:252442 Archived-At: >>> I don't even understand what this is supposed to do. >> >> Yet you happily threw it away :-( > > Because there are no such precautions elsewhere in the code, and the > comment above ("In case garbage collection has removed OLD-BUL") does > not explain what its purpose is. A few lines below, old-bul is used > without such a precaution. Of course, if it has a purpose, it's okay to > keep it. > I didn't remember the main reason why I removed that (cdr ptr). The reason is not only that the comment above it is wrong, but also that this (cdr ptr) condition itself is wrong: it makes that loop stop when the last element of the buffer-undo-list is reached. When buffer-undo-list is initially nil, (funcall body) adds a number of entries in buffer-undo-list, and there is no reason to exit that loop without processing its last element.