unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Alan Mackenzie <acm@muc.de>,
	emacs-devel@gnu.org, martin rudalics <rudalics@gmx.at>
Subject: Re: Problems with syntax-ppss
Date: Mon, 07 Apr 2008 17:14:08 +0200	[thread overview]
Message-ID: <47FA3A40.5080209@gmail.com> (raw)
In-Reply-To: <jwvskxxyb58.fsf-monnier+emacs@gnu.org>

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'.





  reply	other threads:[~2008-04-07 15:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-04 17:26 Problems with syntax-ppss Alan Mackenzie
2008-04-04 17:29 ` Lennart Borgman (gmail)
2008-04-04 20:24 ` Stefan Monnier
2008-04-04 21:14   ` martin rudalics
2008-04-05 14:46     ` Alan Mackenzie
2008-04-05 18:37       ` Stefan Monnier
2008-04-06 14:07         ` Alan Mackenzie
2008-04-07 14:57           ` Stefan Monnier
2008-04-07 15:14             ` Lennart Borgman (gmail) [this message]
2008-04-07 16:43               ` Stefan Monnier
2008-04-07 14:59           ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47FA3A40.5080209@gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).