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: Fri, 06 Feb 2015 12:47:15 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

>> prog-mode sounds good.  That doesn't prevent non-prog modes from using
>> it (and really, modes like xml-mode or latex-mode should inherit from
>> both text-mode and prog-mode).
> Ok, how should I name the variable then?  `submode-indentation-context' ?

I'd use prog-indentation-context.

> The values are provided by the outer mode.  But the inner mode decides
> what it expects in <future> (that's why I called it SUBMODE-SPECIFIC in
> the "real doc").

That requires some cross-knowledge of the two modes.  It's not ideal,
but I guess it's OK.

> While it is true that the chunk specified by MIN/MAX should really be
> considered begin a continuation of a "chunk series", most modes won't
> probably like the idea of having to react to the "text before MIN",
> because that would require them to create a temporary buffer for the
> indent calculation.

Not necessarily: the submode can just go to the end of the previous
chunk, compute some state at that position and use that state as initial
context at MIN.

> Providing a possibility for some initial syntactic context is probably
> easier.  E.g. cc-mode can decide that it can accept some initial value
> for c-syntactic-context...

Providing the location of the previous chunk(s) is all that's needed and
the submode can do that "initial context" dance if that's what it likes.
This is better because the outer mode doesn't need to know about those
"initial contexts".

But we can start without support for that kind of "previous chunks" info
and add it later.  It's often better to add such support only once you
have an actual concrete need for it, so you can check that it really
does satisfy the need.


        Stefan



reply via email to

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