unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Problems with syntax-ppss
@ 2008-04-04 17:26 Alan Mackenzie
  2008-04-04 17:29 ` Lennart Borgman (gmail)
  2008-04-04 20:24 ` Stefan Monnier
  0 siblings, 2 replies; 11+ messages in thread
From: Alan Mackenzie @ 2008-04-04 17:26 UTC (permalink / raw)
  To: emacs-devel

Hi, Emacs!

I've just encountered a rather knotty problem in CC Mode for which
syntax-ppss ought to be a solution; I need to find out, RAPIDLY, whether
a particular buffer position is inside a string or comment.
Unfortunately (for me), ......

syntax-ppss does it's parsing from (point-min), not from BOB.

So if the buffer is currently narrowed, this function will return an
meaningless value for the envisaged use.

But if I widen the buffer first, what happens to syntax-ppss's cache?
Is this just discarded, or are perhaps two caches maintained (one from
BOB, the other from the current (or most recent) (point-min)?

Advice, please!

Forgive me at this point for not reading the fine source code - it's
over 150 lines and looks rather forbidding.

It would be nice if the the Elisp manual could be more explicit on such
points.  (Hey, tell me how it is, and I'll expand the manual!)

I think the doc-string for the function is inadequate - it fails to
state that parsing starts at (point-min) rather than BOB.

Thanks in advance!

-- 
Alan Mackenzie (Nuremberg, Germany).




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-04-07 16:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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)
2008-04-07 16:43               ` Stefan Monnier
2008-04-07 14:59           ` Stefan Monnier

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