From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Problems with syntax-ppss Date: Sun, 6 Apr 2008 14:07:31 +0000 Message-ID: <20080406140731.GA4084@muc.de> References: <20080404172627.GB4804@muc.de> <47F69A4F.1050405@gmx.at> <20080405144642.GA3095@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1207489911 28182 80.91.229.12 (6 Apr 2008 13:51:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Apr 2008 13:51:51 +0000 (UTC) Cc: martin rudalics , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 06 15:52:24 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JiVIA-0004l8-Ok for ged-emacs-devel@m.gmane.org; Sun, 06 Apr 2008 15:52:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JiVHX-0004QM-U9 for ged-emacs-devel@m.gmane.org; Sun, 06 Apr 2008 09:51:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JiVHT-0004Py-Oo for emacs-devel@gnu.org; Sun, 06 Apr 2008 09:51:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JiVHP-0004Lz-8C for emacs-devel@gnu.org; Sun, 06 Apr 2008 09:51:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JiVHP-0004Lw-2g for emacs-devel@gnu.org; Sun, 06 Apr 2008 09:51:31 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JiVHO-0006QE-Dy for emacs-devel@gnu.org; Sun, 06 Apr 2008 09:51:30 -0400 Original-Received: (qmail 30200 invoked by uid 3782); 6 Apr 2008 13:51:23 -0000 Original-Received: from acm.muc.de (p57AF6E92.dip.t-dialin.net [87.175.110.146]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Sun, 06 Apr 2008 15:51:17 +0200 Original-Received: (qmail 4185 invoked by uid 1000); 6 Apr 2008 14:07:32 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:94485 Archived-At: Hi, Stefan, On Sat, Apr 05, 2008 at 02:37:39PM -0400, Stefan Monnier wrote: > >> >I strongly recommend to always call syntax-ppss in a widened > >> >buffer. > >> ... and with match-data saved. > > Er, your replies don't exactly radiate an aura of confidence about > > syntax-ppss. ;-( > > I think you (Stefan) 're saying that the function isn't 100% defined > > for a narrowed buffer. > Indeed. That's not good. > > Will calling s-ppss on a narrowed buffer corrupt the cache at all, > > for example? > Yes it can. Similarly the cache does not keep track of the > syntax-table so if you switch syntax-table between calls you may get > unexpected results. That's also not good. Would it not be a good idea to (i) redefine syntax-ppss as calculating the syntax from BOB (as opposed to (point-min)); (ii) have several caches, each associated with a particular syntax table (how many modes are going to use more than 2 or, perhaps, 3?); (iii) put a `save-match-data' round the function? [ Stuff about performance read and appreciated. ] > Stefan -- Alan Mackenzie (Nuremberg, Germany).