From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Pogonyshev Newsgroups: gmane.emacs.devel Subject: Re: generic buffer parsing cache data Date: Sun, 1 Jul 2007 16:49:32 +0300 Message-ID: <200707011649.32728.pogonyshev@gmx.net> References: <200707010038.23072.pogonyshev@gmx.net> <200707011516.31959.pogonyshev@gmx.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1183298751 5075 80.91.229.12 (1 Jul 2007 14:05:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 1 Jul 2007 14:05:51 +0000 (UTC) Cc: martin rudalics , Stefan Monnier To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 01 16:05:49 2007 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 1I5033-0000Gj-At for ged-emacs-devel@m.gmane.org; Sun, 01 Jul 2007 16:05:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I5032-0004nX-UW for ged-emacs-devel@m.gmane.org; Sun, 01 Jul 2007 10:05:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I502z-0004jM-05 for emacs-devel@gnu.org; Sun, 01 Jul 2007 10:05:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I502y-0004hZ-8g for emacs-devel@gnu.org; Sun, 01 Jul 2007 10:05:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I502y-0004hH-4s for emacs-devel@gnu.org; Sun, 01 Jul 2007 10:05:04 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1I502x-0000dK-Dh for emacs-devel@gnu.org; Sun, 01 Jul 2007 10:05:03 -0400 Original-Received: (qmail invoked by alias); 01 Jul 2007 14:05:02 -0000 Original-Received: from unknown (EHLO [80.94.234.57]) [80.94.234.57] by mail.gmx.net (mp028) with SMTP; 01 Jul 2007 16:05:02 +0200 X-Authenticated: #16844820 X-Provags-ID: V01U2FsdGVkX1/l+vdJRRjlVtyl231wTC7PdZq08pQTpjb501yThu hSETTryavvfQSf User-Agent: KMail/1.7.2 In-Reply-To: Content-Disposition: inline X-Y-GMX-Trusted: 0 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:74108 Archived-At: Stefan Monnier wrote: > >> > I propose that each point position could have "cached parsing data". > >> > This would be an alist indexed with cache data identifier. > >> Have you experimented with `syntax-ppss'? > > I propose to add something generic. For instance, Python mode needs to > > know indentation level of blocks. It seems that `syntax-ppss` doesn't > > return it at all. And adding everything that might ever be needed by > > some XYZ mode seems counter-productive and complicates an already complex > > function and its return value. > > 100% agreement. > > This said, I think it might make sense to combine the two so that > syntax-ppss returns not just the parse-partial-sexp state but also some > mode-specific data. At least it's been in my TODO list for a while now. That would be nice, but I see one possible non-trivial problem here. I'm not sure that `parse-partial-sexp' stores cached data where it is most logical for the current mode. So it might lead to worse cache performance, because `parse-partial-sexp' might choose to store data in more sparse positions in a buffer than its mode would prefer. (However, I might be wrong, there can be a way to influent this.) Also, relying on `parse-partial-sexp' makes caching impossible or very difficult for minor modes, because they don't generally have a say in determining buffer syntax. Paul