From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#39889: emacs-27 and master: unbalanced invocation of after-change-functions in cedet Date: Tue, 3 Mar 2020 20:15:30 +0000 Message-ID: <20200303201530.GA14361@ACM> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="86388"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.10.1 (2018-07-13) To: 39889@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 03 21:16:18 2020 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 1j9Dxh-000MNA-FE for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Mar 2020 21:16:17 +0100 Original-Received: from localhost ([::1]:53294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9Dxg-0004ys-D7 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Mar 2020 15:16:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42705) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9DxT-0004uw-J1 for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2020 15:16:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9DxS-0001jI-J6 for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2020 15:16:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34031) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j9DxS-0001jE-Fc for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2020 15:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j9DxS-0008Pm-BA for bug-gnu-emacs@gnu.org; Tue, 03 Mar 2020 15:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Mar 2020 20:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39889 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.158326653932312 (code B ref -1); Tue, 03 Mar 2020 20:16:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Mar 2020 20:15:39 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-Received: (qmail 13446 invoked by uid 3782); 3 Mar 2020 20:15:32 -0000 Original-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 Original-Received: (qmail 14397 invoked by uid 1000); 3 Mar 2020 20:15:30 -0000 Content-Disposition: inline X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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:176810 Archived-At: 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).