emacs-devel
[Top][All Lists]
Advanced

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

Re: Electric indentation sub-optimality and resolution


From: Le Wang
Subject: Re: Electric indentation sub-optimality and resolution
Date: Sat, 20 Dec 2014 19:36:35 -0500

On Thu, Dec 18, 2014 at 8:08 PM, Óscar Fuentes <address@hidden> wrote:
> I actually really like the behavior of the code I posted.  It has an added
> small bonus.  Normally it does not cleanup pre-existing whitespace.  When I
> modify a line with trailing whitespace it does cleanup that one line,
> something my projects' guidelines allow.

If you work on large projects with a mishmash of participants, this feature is essential.  It's really distracting from the actual work to always have your diffs show unrelated edits.

That's what ws-butler does.

Indeed.   

OTOH, your code is ok for adding it to the user's personal .emacs, but
not for incorporation into Emacs. The code should be made into a minor
mode or an optional feature of electric-indent-mode. Creating a new
minor mode makes more sense, IMO.

"ws-trim" also takes the post-command-hook approach, and it's a full minor-mode.  I found this more active whitespace cleanup distracting.  For example, if I page-up to read some contextual code and page-down, my indentation is gone if I was on a blank line.
 
Anyways, we need to hear the opinion of the author of ws-butler package.
AFAIK he tried a similar approach to yours and found problems with it.

Let's get some historical context by reading this thread: https://lists.gnu.org/archive/html/emacs-devel/2003-02/msg00018.html

ws-trim was proposed there, and apparently it didn't go forward.

ws-butler was made as a quick experiment to see if less obtrusive whitespace management was possible by reusing the highlight-changes-mode mechanisms.  If, it was to be included in Emacs, maybe the feature should be rewritten to independent of highlight-changes-mode.  As it stands, one glaring deficiency is that  you cannot use highlight-changes-mode when using ws-butler-mode.



 


--
Le

reply via email to

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