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#75224: RNG validation unnecessarily marks buffer as changed Date: Sun, 05 Jan 2025 15:43:06 +0200 Message-ID: <861pxh8jh1.fsf@gnu.org> References: <20241231143127.1fd67698@vilij-LIFEBOOK-E744> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7141"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 75224-done@debbugs.gnu.org To: Vili Aapro Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 05 14:44:40 2025 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 1tUQvm-0001hc-IP for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 05 Jan 2025 14:44:38 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tUQvJ-0006vc-6Q; Sun, 05 Jan 2025 08:44:09 -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 1tUQvD-0006tG-A1 for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 08:44:03 -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 1tUQvD-0001XY-1b for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 08:44:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=Qk/zvBCmuunDJZvkSYJD08JgdrlqFokcB1FD8y7Uc8U=; b=FdZm5kzQExZ4XeHf8Il+v4MXGKQw1y0JGuRNseEslm6yy4swNE5kW/Ak5Q14zD1d9RSu4lELJWNCTQtTAMGv0IGcoTNI3yIlQ3qD7z97KMZcxpTNsVyKLmHXP5nBmL4B5TuJ9eJ4bszep7TiEy3PvS1ti+SQMrOTwPC9mqf4rUS2LuX6PuauyAiC52BM2PQVtB7IAv8GXyisFwkYvn1brdbFgvawT02LMK5bVjMkI24T6bR6Elo4iYDp8jFqP6QB0O7eraoZWrVqcHvc+2/q2e40HDTvr9Ccwo7PwtvpxTfo+2sSPx7ARHnwY7NuruPOsA1bxLOsDFZRAetOKuS/Tg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tUQvC-0003nt-S0 for bug-gnu-emacs@gnu.org; Sun, 05 Jan 2025 08:44:02 -0500 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Jan 2025 13:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 75224 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 75224@debbugs.gnu.org, eliz@gnu.org, vili.aapro@iki.fi Original-Received: via spool by 75224-done@debbugs.gnu.org id=D75224.173608459914544 (code D ref 75224); Sun, 05 Jan 2025 13:44:02 +0000 Original-Received: (at 75224-done) by debbugs.gnu.org; 5 Jan 2025 13:43:19 +0000 Original-Received: from localhost ([127.0.0.1]:60399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tUQuU-0003mW-Lb for submit@debbugs.gnu.org; Sun, 05 Jan 2025 08:43:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50832) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tUQuS-0003mJ-Fa for 75224-done@debbugs.gnu.org; Sun, 05 Jan 2025 08:43:17 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tUQuL-0001V4-7T; Sun, 05 Jan 2025 08:43:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Qk/zvBCmuunDJZvkSYJD08JgdrlqFokcB1FD8y7Uc8U=; b=js3JC2ctTxre WTUrv8Eh5f9cW4bH51VJMXFueKY8U0aMt1O3MWoo/J8WGxf0xXaTlP0Gqwx3TpgaeueXubaZSFW+s bOT3/qVGP2H/zcU+6Mog+vColk9dqDFirVhSRR4Y912xALEkMZrOtEOchpUQbeKYfYuled01l15Kc YB/FD1qmPC1PRo/S1LZ034W7ueSHl3tfXQBNx9CbZLgGpsvbZHdvtipnCfOkpYv8C0q9romYemYSz b0Ufmny+nu4JpGMgWMv3StnORafj2RAl18S1S+mv0zzb0fx91hD/6C9L0j/5mbXtxL3gpQffYQkda mmZtO6NKkNkoahCLfquiDw==; In-Reply-To: <20241231143127.1fd67698@vilij-LIFEBOOK-E744> (message from Vili Aapro on Tue, 31 Dec 2024 14:31:27 +0200) 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:298564 Archived-At: > Date: Tue, 31 Dec 2024 14:31:27 +0200 > From: Vili Aapro > > I found a bug in RNG Validation mode in the file `nxml/rng-valid.el' that unnecessarily marks buffer as changed. The bug can be fixed with a simple application of `with-silent-modifications' in the function `rng-do-some-validation-1'. I've attached a patch that does so. However, in the long run, in my opinion the application of `with-silent-modifications' should be moved to `rng-clear-cached-state'; that is where it properly belongs. Perhaps this has been left undone because of efficiency reasons; perhaps there is work to be done to make `with-silent-modifications' less expensive. > > To reproduce, visit a big enough RNG-validatable XML file, such as the included `rdfxml.rng'; goto and end-tag, say on line 22; kill it; undo. > > Undo runs `after-change-functions' and thus `rng-after-change-function' and thus `rng-do-some-validation-1', reproducing the bug. Thanks, I installed this on the master branch, and I'm therefore closing the bug.