[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, 24 Mar 2014 21:54:40 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> Assume that electric indentation happens on \n, and not on {.  You type
> in a { (which is intrinsically 4 characters too indented, for some value
> of 4) then do M-; to insert a comment at comment-column.  You fill in the
> comment, do C-e then RET.  The ensuing electric indentation on RET puts
> out the alignment of the comment:
>                             if (foo)       /* aligned comment */
>                           {          /* coment misaligned by e-i-m */

Ah, you're again pointing out the benefit of adding more chars to
electric-indent-chars.  Fine.  We've already been in violent agreement
on this time for a long time.

>> >> What would be more optimal?
>> > A mode-dependent or buffer-local dependent setting, as well as, rather
>> > than instead of.
>> We have that: electric-indent-local-mode and electric-indent-inhibit.
> OK, for electric-indent-local-mode, which is gradually becoming
> prominent.  But I thought electric-indent-inhibit was a variable for major
> modes, not users - a mode initialisation thing, rather than a user
> configuration variable.

Indeed electric-indent-inhibit is not meant as a user-config.
And electric-indent-mode is not meant as a buffer-local config.
So what?  There is electric-indent-local-mode which is meant as
a buffer-local user-config.

So what is the problem?  Please tell precisely what feature you miss
rather than just criticize the existing ones.

>> Lack of patch implementing this (supposed) simple change?
> Here is what I propose, and am willing to do:
> 1. For electric indentation:
>   a - Restore `newline' and `newline-and-indent' to their traditional
>     functionality, and remove `electric-newline-and-maybe-indent'.
>   b - Simplify `electric-indent-post-self-insert-function' such that it
>     reindents only the line on which the self-inserting character is
>     typed.
>   c - Reform `electric-indent-local-mode' as a first-class minor mode and
>     `electric-indent-mode' as a global version of it.
> 2. For making RET indent the new line in programming modes:
>   a - Bind RET to `newline-and-indent' and C-j to `newline' in
>     `prog-mode-map' and possibly in certain other major mode maps (to be
>     discussed).
>   b - (Maybe) create a minor mode to restore RET and C-j to traditional
>     bindings.
> The above will leave electric-indent-mode functioning pretty much as it
> currently does.  What do you say?

I want to keep electric-indent-mode as a global mode that determines
whether certain self-inserting keys (such as RET and others) auto-indent.

>> So make this bug report specific about a particular circumstance where
>> the behavior is undesirable, or about how hard it is to disable it.
> I think RMS's bug #16156, reproduced and being discussed on a parallel
> thread, is a good enough example, so there's not much point in me opening
> a new one.

Then post in that bug explaining why the behavior is undesirable or how
hard it is to disable it.


reply via email to

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