From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: Problems with syntax-ppss Date: Mon, 07 Apr 2008 17:14:08 +0200 Message-ID: <47FA3A40.5080209@gmail.com> References: <20080404172627.GB4804@muc.de> <47F69A4F.1050405@gmx.at> <20080405144642.GA3095@muc.de> <20080406140731.GA4084@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1207581280 9169 80.91.229.12 (7 Apr 2008 15:14:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Apr 2008 15:14:40 +0000 (UTC) Cc: Alan Mackenzie , emacs-devel@gnu.org, martin rudalics To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 07 17:15:03 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 1Jit3m-0005jK-TH for ged-emacs-devel@m.gmane.org; Mon, 07 Apr 2008 17:15:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jit39-0000RD-7L for ged-emacs-devel@m.gmane.org; Mon, 07 Apr 2008 11:14:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jit35-0000Qx-UD for emacs-devel@gnu.org; Mon, 07 Apr 2008 11:14:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jit34-0000Qb-MN for emacs-devel@gnu.org; Mon, 07 Apr 2008 11:14:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jit34-0000QY-J8 for emacs-devel@gnu.org; Mon, 07 Apr 2008 11:14:18 -0400 Original-Received: from ch-smtp01.sth.basefarm.net ([80.76.149.212]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jit34-00078N-4F for emacs-devel@gnu.org; Mon, 07 Apr 2008 11:14:18 -0400 Original-Received: from c83-254-150-27.bredband.comhem.se ([83.254.150.27]:61945 helo=[127.0.0.1]) by ch-smtp01.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1Jit31-0005mH-4s; Mon, 07 Apr 2008 17:14:15 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: X-Antivirus: avast! (VPS 080407-0, 2008-04-07), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.150.27 X-Scan-Result: No virus found in message 1Jit31-0005mH-4s. X-Scan-Signature: ch-smtp01.sth.basefarm.net 1Jit31-0005mH-4s 044edbbc4df34d16832c43feb9a73bac X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) 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:94574 Archived-At: Stefan Monnier wrote: >> Would it not be a good idea to (i) redefine syntax-ppss as calculating >> the syntax from BOB (as opposed to (point-min)); > > That's already what it does, when it can. Maybe it could be improved as > follows: signal an error if it needs to recompute from (point-min) and > (point-min) is not the beginning of the buffer, unless the caller sets > a `syntax-ppss-narrowed-is-ok' variable (for use in modes like Info and > Rmail). Maybe that variable should be shared with font-lock-dont-widen. Until I had to start reading the code I thought that font-lock-dont-widen already took care of this. I think there have to be a way to tell syntax-ppss not to widen otherwise I can't see what purpose font-lock-dont-widen could have (but I guess I am missing something there?). Adding a new variable syntax-ppss-narrowed-is-ok might be good, but should not font-lock-dont-widen be honored regardless of this? Or should perhaps font-lock set the new variable as needed? >> (ii) have several caches, each associated with a particular syntax >> table (how many modes are going to use more than 2 or, perhaps, 3?); > > This may incur a significant cost. I much prefer to let the caller > decide when a change of syntax-table requires flushing the cache. Looks better to me since flushing is done based on the position in the buffer. > Another approach might be to introduce a `syntax-ppss-syntax-table'.