[Top][All Lists]

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

Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC

From: Stefan
Subject: Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC Mode. Bug #15478.
Date: Mon, 17 Mar 2014 11:48:16 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>> Right.  But I don't see what is so special about the C language that
>> makes c-electric-flag (aka electric-indent-mode) indispensable in c-mode.
> CC Mode modes don't indent correctly automatically without electric
> indentation.

And the same holds true for all other programming modes.
Nothing special here.

For some major modes (like Lisp), using newline-and-indent is sufficient
to indent code as you type it.  For most others,
reindent-then-newline-and-indent is needed instead.

I don't know of any mode where electric behavior of something else than
the newline character is needed for the "typical case where lines of
code are being typed in, line by line".  But since this "typical case"
is not that typical, several major modes elect to make a few other keys
electric so as to try and maintain indentation even when code is being
modified rather than just being written linearly.

Maybe the special part of c-mode is that you used a set of electric
chars which is sufficient and yet does not include newline.

> Not quite.  I want the default for CC Mode modes to be t, regardless of
> any system wide default.

I know you steadfastly refuse to recognize that this is your personal
preference rather than a requirement of the languages you support.

> I think you are wrong in your tacit assumption that liking of e-i-m is
> person dependent rather than major mode dependent.

There are details about *how* e-i-m works which depend on the mode.
Yes.  That's why e-i-m has mode-local settings (e.g. which keys are
electric, or whether the indentation algorithm can reliably reindent).

But the global e-i-m setting is about deciding whether the user wants
his code to be automatically indented as he types (to the extent
possible).  It is *defined* as a person-dependent preference.

> The way electric-indent-mode was implemented seems optimised to maximise
> the difficulty of integrating CC Mode with it.

Of course, my main objective was to piss you off and make your
life miserable.  It hasn't worked as well as planned, but this is not
quite over yet ;-)


reply via email to

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