From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#16526: 24.3.50; scroll-conservatively & c-mode regression Date: Wed, 2 Jul 2014 18:40:13 +0000 Message-ID: <20140702184013.GA3823__20180.4652846933$1404326740$gmane$org@acm.acm> References: <20140628130059.GA4144@acm.acm> <53AECA88.7010401@gmx.at> <20140628145509.GB4144@acm.acm> <53AFD1FA.5010201@gmx.at> <20140629091757.GA2948@acm.acm> <53AFE536.7010407@gmx.at> <20140629124829.GC2948@acm.acm> <53B02042.1050107@gmx.at> <20140629144151.GD2948@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1404326740 32590 80.91.229.3 (2 Jul 2014 18:45:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Jul 2014 18:45:40 +0000 (UTC) Cc: 16526-done@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 02 20:45:32 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X2PX7-0002r7-Ki for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Jul 2014 20:45:29 +0200 Original-Received: from localhost ([::1]:56014 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2PX6-0002oW-VX for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Jul 2014 14:45:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2PWw-0002mb-FU for bug-gnu-emacs@gnu.org; Wed, 02 Jul 2014 14:45:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2PWo-0004CS-Vz for bug-gnu-emacs@gnu.org; Wed, 02 Jul 2014 14:45:18 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2PWh-00042J-1B; Wed, 02 Jul 2014 14:45:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X2PWg-00078o-1Z; Wed, 02 Jul 2014 14:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Wed, 02 Jul 2014 18:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16526 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 16526-done@debbugs.gnu.org id=D16526.140432669427416 (code D ref 16526); Wed, 02 Jul 2014 18:45:01 +0000 Original-Received: (at 16526-done) by debbugs.gnu.org; 2 Jul 2014 18:44:54 +0000 Original-Received: from localhost ([127.0.0.1]:40709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X2PWX-000787-Jt for submit@debbugs.gnu.org; Wed, 02 Jul 2014 14:44:54 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:33281 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X2PWV-00077v-AQ for 16526-done@debbugs.gnu.org; Wed, 02 Jul 2014 14:44:52 -0400 Original-Received: (qmail 45868 invoked by uid 3782); 2 Jul 2014 18:44:49 -0000 Original-Received: from acm.muc.de (pD9519C56.dip0.t-ipconnect.de [217.81.156.86]) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 02 Jul 2014 20:44:45 +0200 Original-Received: (qmail 3951 invoked by uid 1000); 2 Jul 2014 18:40:13 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91112 Archived-At: Hello, Stefan. On Sun, Jun 29, 2014 at 06:14:45PM -0400, Stefan Monnier wrote: > > scan-lists, a primitive, must be utterly robust. syntax-ppss is too > > fragile to be used here without a lot of hardening. > FWIW, CC-mode is one of the last remaining major modes (at least the > only one I know of that's bundled with Emacs) that doesn't play nice > with syntax-ppss. Doesn't it? First I've heard of it. Though of course, what comes out of syntax-ppss is going to be of limited value when you've got lines like this in your source: #define FOO BAR /* accidentally unclosed comment. Just as a matter of interest, what code is there around which wants to use syntax-ppss on a CC Mode buffer? > Incidentally, AFAIK it's also the only code which uses > font-lock-extend-after-change-region-function .... Is that right? Well, what do you know! Still, it's a good facility to have around for when it's needed. It avoids the need to have to advise font-lock after change functions, whilst still doing fontification right. > .... (and yes, I think the two are (indirectly) related). Well, everything's related to everything else, more or less indirectly. Do you think there's any significance to this indirect relationship? > > If one were to harden syntax-ppss against all these things, one would > > probably end up calculating the cache from scratch every time, in effect. > Exactly. IOW a cache can only be robust if the major mode plays by the > rules, which cc-mode doesn't do. CC Mode does what it has to do to do its job. As you yourself, amongst others, have remarked, CC Mode deals with utter bastards of languages. Its caches are quite capable of being robust. I'm not convinced that syntax-ppss is capable of being robust. Some of its shortcomings are listed in syntax.el. > Stefan -- Alan Mackenzie (Nuremberg, Germany).