[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CEDET merge

From: Eric M. Ludlam
Subject: Re: CEDET merge
Date: Sun, 04 Oct 2009 08:44:02 -0400

On Sun, 2009-10-04 at 01:52 -0400, Chong Yidong wrote:
> "Eric M. Ludlam" <address@hidden> writes:
> > Does the Emacs integrated CEDET no longer use mode-local to call
> > semantic-new-buffer-fcn?  That could be good news.  The hooks available
> > in Emacs to detect a change in major mode for mode-local.el have been
> > challenging to get right, and I think they can still sometimes not work
> > right.
> No, semantic-new-buffer-fcn is still called from mode-local.  I was
> proposing to move the parser setup functions from the mode hooks into
> semantic-new-buffer-fcn.  That way, we can parse an existing buffer
> (e.g., a buffer that already exists by the time Semantic is enabled, or
> a buffer that Srecode wants to parse without enabling Semantic
> globally), simply by calling semantic-new-buffer-fcn.

Hmmm.  If, say, a semantic-*-default-setup function was a mode-local
function just called `semantic-default-setup', then
semantic-new-buffer-fcn could always just call that, and mode-local
would dispatch to the correct variant.  In that way, it would only be
called once per buffer, and there would be no reliance on mode hooks.

Since semantic-new-buffer-fcn will run its contents on once, it, in
turn, could be called from the routines that parse a buffer, requiring
no further code changes.

Of course, that change would force mode-local to start up, which would
then enable any other similarly configured mode.  How could
semantic-mode add something to Emacs' running environment to dynamically
load in a language's support file?  Would that still be via mode-hooks?

Or is the proposal that srecode-template-mode is now calling
semantic-new-buffer-fcn explicitly?  That seems simple enough, though we
don't need to stop using mode hooks in the general case, only in the
srecode-template case.

I seem to be having trouble wrapping my head around this topic.  It
literally took years to work out all the kinks in the Semantic setup as
I distribute it.  I am both hopeful, and worried about trying to make it


reply via email to

[Prev in Thread] Current Thread [Next in Thread]