emacs-devel
[Top][All Lists]
Advanced

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

Re: antlr-mode.el - need some support by python.el


From: Stefan Monnier
Subject: Re: antlr-mode.el - need some support by python.el
Date: Tue, 17 Feb 2015 19:00:59 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> This is exactly the difference between 5 (yours) and 4 (mine) below

I think we're misunderstanding each other.

> Actually not.  In both cases, the submode provides the code.

> In 4, the sub mode provides a function to compute the initial parse
> state given the string / chunks.  It can do that quite simply by
> inserting it/them into a temporary buffer and using a function which
> computes the syntactic context at the end of that buffer - most major
> mode already have such a function.  In other words: the effort for the
> submode is small.

IIUC you're suggesting that the submode provides a function "get-state"
to the outer mode, and the outer mode calls this "get-state" with some
"previous-chunk-descriptor" (either buffer positions or a string)
on the previous chunk and then passes the result to the submode.

> In 5, they follow your idea:
[...]
> To me, that seems to be more work.

The only difference is that the submode doesn't provide "get-state" to
the outer mode, instead the outer mode provides the
"previous-chunk-descriptor" and the submode calls "get-state" on it if
it wants to.

> Performance-wise, this could be better in the literate programming use
> case, but not in my use case.

I think the two are pretty much identical.

>> In any case your patch looks good, feel free to install it.
> If I might come back to your offer from last month (concerning
> antlr-mode.el, actually) - it would be excellent if you could apply the
> prog-mode.el.patch to the Emacs repository...

OK, will do,


        Stefan



reply via email to

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