From unknown Sat Jun 14 03:50:11 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#39889 <39889@debbugs.gnu.org> To: bug#39889 <39889@debbugs.gnu.org> Subject: Status: emacs-27 and master: unbalanced invocation of after-change-functions in cedet Reply-To: bug#39889 <39889@debbugs.gnu.org> Date: Sat, 14 Jun 2025 10:50:11 +0000 retitle 39889 emacs-27 and master: unbalanced invocation of after-change-fu= nctions in cedet reassign 39889 emacs submitter 39889 Alan Mackenzie severity 39889 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 03 15:15:39 2020 Received: (at submit) by debbugs.gnu.org; 3 Mar 2020 20:15:39 +0000 Received: from localhost ([127.0.0.1]:40004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9Dx5-0008P5-E1 for submit@debbugs.gnu.org; Tue, 03 Mar 2020 15:15:39 -0500 Received: from lists.gnu.org ([209.51.188.17]:53039) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9Dx3-0008Ox-9k for submit@debbugs.gnu.org; Tue, 03 Mar 2020 15:15:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42597) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9Dx2-0004X2-8y for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2020 15:15:37 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9Dx1-0001Oe-4r for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2020 15:15:36 -0500 Received: from colin.muc.de ([193.149.48.1]:60279 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1j9Dx0-0001FV-PE for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2020 15:15:35 -0500 Received: (qmail 13446 invoked by uid 3782); 3 Mar 2020 20:15:32 -0000 Received: from acm.muc.de (p4FE15A93.dip0.t-ipconnect.de [79.225.90.147]) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 03 Mar 2020 21:15:31 +0100 Received: (qmail 14397 invoked by uid 1000); 3 Mar 2020 20:15:30 -0000 Date: Tue, 3 Mar 2020 20:15:30 +0000 To: bug-gnu-emacs@gnu.org Subject: emacs-27 and master: unbalanced invocation of after-change-functions in cedet Message-ID: <20200303201530.GA14361@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Emacs. In both the emacs-27 and master branches, in .../lisp/cedet/srecode/insert.el, function srecode-insert-fcn, after-change-functions is invoked without a matching invocation of before-change-functions. This violates the specified use of these hooks described on the page "Change Hooks" in the Elisp manual. CC Mode can recover from this scenario, though its recovery is slow (it essentially runs the change hooks over the entire buffer). It is not clear whether or not the syntax-ppss mechanism will recover gracefully from this bug. Any other uses of before-change-functions will probably suffer corruption from this bug. It looks like a good solution might well be to surround the pertinent code with the combine-change-calls macro, at least for Emacs-27 onwards. For the use of the cedet package in older emacsen, an explicit invocation of before-change-functions needs adding. -- Alan Mackenzie (Nuremberg, Germany).