From: "Óscar Fuentes" <ofv@wanadoo.es>
To: emacs-devel@gnu.org
Subject: Re: Electric indentation sub-optimality and resolution
Date: Fri, 19 Dec 2014 02:08:34 +0100 [thread overview]
Message-ID: <87oar0v431.fsf@wanadoo.es> (raw)
In-Reply-To: CAJnXXohac+45BQ9j0mkMVX=+VgKC+_bofCozvehoCByVTL2avw@mail.gmail.com
John Yates <john@yates-sheets.org> writes:
> On Thu, Dec 18, 2014 at 3:07 PM, Dmitry Gutov <dgutov@yandex.ru> wrote:
>>
>> Personally, I like this lighter-weight approach:
>>
>> https://github.com/purcell/whitespace-cleanup-mode
>
>
> In my case I have show-trailing-whitespace set and my trailing-whitespace
> face is "red3". That made it very painful to insert blank lines in the
> presence of cc-mode's new electric indentation, even when some other
> mechanism / package / mode ultimately was going to clean things up
> (assuming I saved the file). Until I did a save my new electric whitespace
> messes were "in my face".
I had a similar setup here, but after using ws-butler it made no sense
anymore, since that package ensures that the file does not end with
newly added trailing whitespace.
> Steve Purcell's approach works only if one's file is pristine.
Yes, that disqualifies his package for me.
> Prior to
> the introduction of electric indentation I had no need of such a package: I
> was careful not to introduce inappropriate whitespace. But since I
> regularly have to work on files where other people have been less
> fastidious Steve's package would not clean these electric whitespace messes.
>
> 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.
That's what ws-butler does.
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.
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.
next prev parent reply other threads:[~2014-12-19 1:08 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 [this message]
2014-12-21 0:36 ` Le Wang
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=87oar0v431.fsf@wanadoo.es \
--to=ofv@wanadoo.es \
--cc=emacs-devel@gnu.org \
/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).