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: Thu, 5 Feb 2015 11:39:59 +0000

Hi Stefan,

>>  1. How am I supposed to integrate this into the main Emacs branch?  My
>>     current idea is to do this after some cleanup.

> You can send a patch, or I can provide you with write access.  You can
> do it "all at once in the end" or in smaller chunks, as you wish.

OK, thanks. Then I wait until I have finished the `defcustom's for the
different ANTLR flavors and the different sublanguages.

>     Q: Does the maintainer of python.el has some time to do some (small)
>     change there, or am I supposed to send a patch?

> I believe he reads this mailing-list, so he'll probably answer, but
> otherwise you can contact him directly.

For my last minor antlr-mode release, I also provided a patch proposal
for python.el

Ok, I'll send a specific followup, put Fabián also directly into the
"To" header and use a catchier subject (starting with python.el).

>> There are three potential issues when I call the indentation engine of
>> the "sub-mode" (if it is not based on cc-mode) - see below for an
>> example.

> These problems seem to be fairly general (apply to any multi-mode
> situation), so do not hesitate to suggest introducing general guidelines
> or new functionality to make it easier for major modes to behave well
> for your use-case.

You are right - for a start, I started with a variable specifically for
Python, but in the end, I would see it as part of prog-mode (s/th like
xml-mode would not be covered, but to make it part of fundamental-mode
is probably too generic?).

Here is the variable I defined in my python.el patch proposal:

+ (defvar python-submode-indentation-context nil
+   "((MIN . MAX) LEFTMOST-COL . <future>).")

Ok, here is some real doc:

   Non-nil while indenting lines considered as belonging to a sub mode.

   There are languages where part of the code is actually written in a sub
   language, e.g. a Yacc/Bison grammar also consists of plain C code.  This
   variables enables the major mode of the main language to use the
   indentation function of the sub language for lines belonging the code
   of the sub language.

   When a major mode of such a main language decides to propagate the
   indentation of a line/region to the indentation engine of the sub
   mode, it is supposed to bind this variable to non-nil around the call.
   The non-nil value looks as follows
      ((MIN . MAX) LEFTMOST-COL . SUBMODE-SPECIFIC)

   MIN to MAX is the region consisting of code of the sub mode.
   LEFTMOST-COL is the minimum column the indentation engine of the sub
   mode should choose (instead of 0).  SUBMODE-SPECIFIC can be used to
   allow the indentation engine of the submode work well on code
   snippets (not complete programs), e.g. by providing
   `defun-block-intro' (instead `topmost-intro') to the indentation
   engine of cc-mode.

Is this fine for you?  Should I send a corresponding patch to
progmodes/prog-mode.el ?

   Christoph



reply via email to

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