emacs-devel
[Top][All Lists]
Advanced

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

Electric indentation (Was: Re: js.el changes)


From: Daniel Colascione
Subject: Electric indentation (Was: Re: js.el changes)
Date: Fri, 21 Aug 2009 12:18:27 -0400
User-agent: KMail/1.11.4 (Linux/2.6.29.6-217.2.8.fc11.i586; KDE/4.2.4; i686; ; )

On Friday 14 August 2009, you wrote:
> 4. I removed the "electric indentation" feature implemented by
> js-auto-indent-flag and js-insert-and-indent.  I appreciate the intent,
> but it's not consistent with the way the other programming modes work,
> and this behavior should be implemented separately---as a minor mode
> that can be used generally.  Feel free to suggest this on emacs-devel.

I agree that a generic toggle switch for electric indentation would be nice. 
However, there's quite a bit of precedent for modes implementing their own 
electric indentation, often using complex logic (see c-electric-brace).

To me, the simplest option would be to create a new trivial minor mode, 
electric-indentation-mode, and modify all current mode-specific indentation 
code to check that mode's flag instead of relying on something mode-specific 
like js-auto-indent-flag or c-electric-flag. The actual mode-specific 
indentation can survive otherwise unchanged.




reply via email to

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