[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: Alan Mackenzie
Subject: Re: [Emacs-diffs] trunk r116461: Connect electric-indent-mode up with CC Mode. Bug #15478.
Date: Sun, 2 Mar 2014 11:51:18 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

Hello, Stefan.

On Sat, Mar 01, 2014 at 10:57:34AM -0500, Stefan Monnier wrote:
> >> > The other bit takes over the value of c-electric-indent-mode into CC
> >> > Mode only when it has been set by the user, thus preventing
> >> > electric.el's default overriding CC Mode's.
> >> For that I think it's better to only obey electric-indent-mode if
> >> Emacs>24.3 rather than use the electric-indent-mode-has-been-called crutch.

Using version numbers to check for features is not exactly clean coding.

> > That does not achieve the same effect.

> Can you give a scenario where the result is different?

The default for electric-indent-mode is changed in a future Emacs

> > Please don't do this.  I meant literally what I wrote.

> Yes, but I hate this electric-indent-mode-has-been-called crutch, so we
> need a different solution.

> > A better solution would be to provide a less ugly way of checking whether
> > a user has called electric-indent-mode

> A different way would still be ugly, because this requirement is itself
> ugly.  We need to find a solution that does not depend on *how* we got
> to this state.

By "this state" you mean what?  The minor mode electric-indent-mode can
be in any of three states: (i) left at its default, (ii) set (or toggled)
to t, (iii) set (or toggled) to nil.

The challenge is to distinguish between (i) and ((ii) or (iii)).

>         Stefan

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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