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: Wedler, Christoph
Subject: RE: antlr-mode.el - need some support by python.el
Date: Fri, 6 Feb 2015 15:14:02 +0000

> 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' ?

>> + (defvar python-submode-indentation-context nil
>> +   "((MIN . MAX) LEFTMOST-COL . <future>).")
>> Ok, here is some real doc:

> Sounds like a good start.  Two questions:
> - how/who provides the <future>?  Is it the outer mode (which hence
>   needs "internal" knowledge of the inner mode)?
> - for some outer modes (think of a literate programming mode, for
>   example), the chunk specified by MIN/MAX should really be considered
>   as being a continuation of a previous chunk.  So maybe the inner mode
>   should be provided with some way to find the "text before MIN" (if any).

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").  Reason: the outer mode wants support from the inner
mode, thus it should be easy for the inner mode... (and there are more
potential inner than outer modes).

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.

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

   Christoph



reply via email to

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