From: Le Wang <l26wang@gmail.com>
To: "Óscar Fuentes" <ofv@wanadoo.es>
Cc: emacs-devel@gnu.org
Subject: Re: Electric indentation sub-optimality and resolution
Date: Sat, 20 Dec 2014 19:36:35 -0500 [thread overview]
Message-ID: <CAM=K+ipdBnoz+zFSOcWborZpV13pAcUCNCpuZtLE7SsnLx3sqQ@mail.gmail.com> (raw)
In-Reply-To: <87oar0v431.fsf@wanadoo.es>
[-- Attachment #1: Type: text/plain, Size: 1889 bytes --]
On Thu, Dec 18, 2014 at 8:08 PM, Óscar Fuentes <ofv@wanadoo.es> 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
[-- Attachment #2: Type: text/html, Size: 3198 bytes --]
prev parent reply other threads:[~2014-12-21 0:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-18 16:19 Electric indentation sub-optimality and resolution John Yates
2014-12-18 18:34 ` Óscar Fuentes
2014-12-18 19:13 ` Stefan Monnier
2014-12-18 19:40 ` Óscar Fuentes
2014-12-18 20:07 ` Dmitry Gutov
2014-12-19 0:43 ` John Yates
2014-12-19 1:08 ` Óscar Fuentes
2014-12-21 0:36 ` Le Wang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAM=K+ipdBnoz+zFSOcWborZpV13pAcUCNCpuZtLE7SsnLx3sqQ@mail.gmail.com' \
--to=l26wang@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=ofv@wanadoo.es \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).