From: Alan Mackenzie <acm@muc.de>
To: Lennart Borgman <lennart.borgman@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: C Mode: acceleration in brace deserts.
Date: Thu, 3 Dec 2009 16:59:37 +0000 [thread overview]
Message-ID: <20091203165937.GB1942@muc.de> (raw)
In-Reply-To: <e01d8a50912030826v722fb6ddifb30f2f45049cb75@mail.gmail.com>
Hi, Lennart!
On Thu, Dec 03, 2009 at 05:26:57PM +0100, Lennart Borgman wrote:
> Hi Alan,
> Can you tell me how the cache [c-parse-state] is implemented so I can
> support it in MuMaMo?
Short brusque answer: no - it's ~1300 lines of code, much of it arcane.
Slightly longer answer: The cache's structure is a list of the positions
of each successively enclosing brace/bracket/paren from point going back
to the top level. Additionally, if there is a brace pair preceding such
a b/b/p, it is recorded as a cons. Also there is a "good position", a
position where the cache is known to be valid.
When c-state-cache is called from a new position, the cache is usually
updated rather than being calculated from scratch. The involves
removing entries from the cache which are now later than point, removing
other entries which aren't relevant, since they've been "closed off",
etc. - then scanning forward pairs of parens at a time successively
entering deeper levels (see `c-append-to-state-cache'). Lots of dirty
tricks are used to speed up the process as much as possible.
Sorry I can't be more help, here. But if you've any specific questions,
let me know.
> Best wishes,
> L
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2009-12-03 16:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-03 16:21 C Mode: acceleration in brace deserts Alan Mackenzie
2009-12-03 16:26 ` Lennart Borgman
2009-12-03 16:59 ` Alan Mackenzie [this message]
2009-12-03 17:22 ` Lennart Borgman
2009-12-03 19:39 ` Alan Mackenzie
2009-12-03 19:57 ` Lennart Borgman
2009-12-04 10:34 ` Lennart Borgman
2009-12-04 11:03 ` Lennart Borgman
2009-12-04 11:56 ` Alan Mackenzie
2009-12-04 12:03 ` Lennart Borgman
2009-12-04 12:18 ` Lennart Borgman
2009-12-04 13:54 ` Alan Mackenzie
2009-12-04 19:03 ` Lennart Borgman
2009-12-05 2:11 ` Lennart Borgman
2009-12-05 4:49 ` Stefan Monnier
2009-12-04 5:31 ` Richard Stallman
2009-12-04 11:37 ` Alan Mackenzie
2009-12-05 6:50 ` Richard Stallman
2009-12-03 17:09 ` 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=20091203165937.GB1942@muc.de \
--to=acm@muc.de \
--cc=emacs-devel@gnu.org \
--cc=lennart.borgman@gmail.com \
/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).