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#1501: Emacs 22 loses undo buffer Date: Wed, 20 Oct 2021 15:05:34 +0300 Message-ID: <83k0i7c35d.fsf@gnu.org> References: <85k1b7k763.fsf@gmail.com> <87ef1engij.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8871"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emerick@gmail.com, 1501@debbugs.gnu.org, cyd@stupidchicken.com, npostavs@gmail.com To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 20 14:13:17 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 1mdAT7-0002A5-0k for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Oct 2021 14:13:17 +0200 Original-Received: from localhost ([::1]:55606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdAT6-00082l-2T for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Oct 2021 08:13:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdAN4-0002LP-J3 for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2021 08:07:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41373) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdAN4-00049n-9p for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2021 08:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mdAN4-00076H-2i for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2021 08:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Oct 2021 12:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 1501 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 1501-submit@debbugs.gnu.org id=B1501.163473156227203 (code B ref 1501); Wed, 20 Oct 2021 12:07:02 +0000 Original-Received: (at 1501) by debbugs.gnu.org; 20 Oct 2021 12:06:02 +0000 Original-Received: from localhost ([127.0.0.1]:52918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mdAM5-00074e-Q2 for submit@debbugs.gnu.org; Wed, 20 Oct 2021 08:06:01 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39990) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mdAM4-00074O-AX for 1501@debbugs.gnu.org; Wed, 20 Oct 2021 08:06:00 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35550) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdALy-00037L-NI; Wed, 20 Oct 2021 08:05:54 -0400 Original-Received: from [87.69.77.57] (port=1056 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 1mdALc-0002Ta-56; Wed, 20 Oct 2021 08:05:46 -0400 In-Reply-To: (message from Stefan Kangas on Tue, 19 Oct 2021 18:01:43 -0700) 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:217657 Archived-At: > From: Stefan Kangas > Date: Tue, 19 Oct 2021 18:01:43 -0700 > Cc: Emerick Rogul , 1501@debbugs.gnu.org, > Chong Yidong > > + /* Remove the `face' property to save space. (Bug1501) */ > + if (!NILP (string)) > + Fremove_list_of_text_properties (make_fixnum (0), > + make_fixnum (SCHARS (string)), > + CALLN (Flist, Qface), > + string); This modifies the text properties of STRING, which you don't own. Also, it will do unnecessary non-trivial processing when undo is turned off. I definitely think that with the enlarged undo-limit we should leave this obscure situation alone. It isn't worth making such significant low-level changes due to such obscure problems, which are arguably cockpit errors.