help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Set variable in derived mode before running the parent mode function


From: Philipp Stephani
Subject: Re: Set variable in derived mode before running the parent mode function
Date: Sun, 21 Jun 2015 12:24:34 +0000

Andreas Röhler <andreas.roehler@easy-emacs.de> schrieb am So., 7. Juni 2015
um 13:52 Uhr:

>
> Am 06.06.2015 um 17:58 schrieb Philipp Stephani:
> > Stefan Monnier <monnier@iro.umontreal.ca> schrieb am Mi., 3. Juni 2015
> um
> > 03:15 Uhr:
> >
> >>> `python-mode' are inappropriate for the derived mode; in particular,
> I'd
> >>> like to disable auto-guessing of the indentation by setting
> >>> `python-indent-guess-indent-offset' to nil.  However,
> >>> `define-derived-mode' has no customization point for running code
> before
> >>> the parent mode function.  What's the best way to solve this?
> >> Add the code *after* running python-mode?  After all, setting vars
> >> before would be a waste since python-mode (like all other proper major
> >> modes) begins by calling kill-all-local-variables (also known as
> >> fundamental-mode).
> >>
> >>
> >>
> > You're right, that wouldn't work. The problem is that
> > python-indent-guess-indent-offset prints a message if it couldn't guess
> the
> > indentation; I'd like to suppress that message.
>
>
> Disabling a message is another thing than disabling auto-guessing.
>
> Look into python.el, definition of
>
> python-indent-guess-indent-offset
>
> Messaging is done from last line there. Put it at an extra line - i.e. a
> new line at the end of "(message
> " sexp. Than comment out that line.
>
>
Sure, but that would disable the message for all users. I could totally
live with that (Emacs is already too chatty), but Stefan would need to
agree that it's fine to remove the message entirely.


reply via email to

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