From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Yates Newsgroups: gmane.emacs.devel Subject: Re: Electric indentation sub-optimality and resolution Date: Thu, 18 Dec 2014 19:43:12 -0500 Message-ID: References: <87wq5ovmbb.fsf@wanadoo.es> <86388chgci.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c1e9ee56d99d050a86fe6c X-Trace: ger.gmane.org 1418949805 27448 80.91.229.3 (19 Dec 2014 00:43:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 19 Dec 2014 00:43:25 +0000 (UTC) Cc: =?UTF-8?Q?=C3=93scar_Fuentes?= , Emacs developers To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 19 01:43:19 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y1lf5-0005l2-Fj for ged-emacs-devel@m.gmane.org; Fri, 19 Dec 2014 01:43:19 +0100 Original-Received: from localhost ([::1]:56145 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1lf4-000668-SR for ged-emacs-devel@m.gmane.org; Thu, 18 Dec 2014 19:43:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1lf0-000662-Sm for emacs-devel@gnu.org; Thu, 18 Dec 2014 19:43:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1lez-0004Jl-Lw for emacs-devel@gnu.org; Thu, 18 Dec 2014 19:43:14 -0500 Original-Received: from mail-ob0-x22d.google.com ([2607:f8b0:4003:c01::22d]:52780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1lez-0004JY-GK for emacs-devel@gnu.org; Thu, 18 Dec 2014 19:43:13 -0500 Original-Received: by mail-ob0-f173.google.com with SMTP id uy5so8483541obc.4 for ; Thu, 18 Dec 2014 16:43:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=50Q4wL+x/3k5UW7H6uvp7DkSs1qYPY8QFOn5k3oTUsM=; b=iX3E2nfdb6k347fkig4gfBxYQQHbGhROrxiFr+t4nGD4mLJN084KFYQqKZpdWYWzhC f1zbUAdiwncAS8RPrsPli0cUC7ezQTLvJs8Qwk2LKraM2wHJgWCXEJgpVi0kUpJuQHQj alJvnyI+T4gePjQ7Z2SjoyNujiBj9CJJd4rls/n39Hc8asMjvFmtCjRnrCbUSTYphbp+ 7CJYgXQFW5j0TSbiwWTo4syWZo1XnbYQcYJMkJ4XTnxOlqCPTE7ZY3wFnI/Q8lCiQBfF XOZeXrrDaK8CcDYkF71MUUo7qgWTJLGgFFM+2Th0ha5TFe5Fu20NO/I+T5djxWSp6oho +8CQ== X-Received: by 10.236.223.198 with SMTP id v66mr4478818yhp.38.1418949792550; Thu, 18 Dec 2014 16:43:12 -0800 (PST) Original-Received: by 10.170.224.5 with HTTP; Thu, 18 Dec 2014 16:43:12 -0800 (PST) In-Reply-To: <86388chgci.fsf@yandex.ru> X-Google-Sender-Auth: v2Tj2WwVNTmdBWWkxVkw7m54Sl4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:180302 Archived-At: --001a11c1e9ee56d99d050a86fe6c Content-Type: text/plain; charset=UTF-8 On Thu, Dec 18, 2014 at 3:07 PM, Dmitry Gutov 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". Steve Purcell's approach works only if one's file is pristine. 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. /john --001a11c1e9ee56d99d050a86fe6c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On T= hu, 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 tra= iling-whitespace face is "red3".=C2=A0 That made it very painful = to insert blank lines in the presence of cc-mode's new electric indenta= tion, even when some other mechanism / package / mode ultimately was going = to clean things up (assuming I saved the file).=C2=A0 Until I did a save my= new electric whitespace messes were "in my face".

=
Steve Purcell's approach works only if one's file is pri= stine.=C2=A0 Prior to the introduction of electric indentation I had no nee= d of such a package: I was careful not to introduce inappropriate whitespac= e.=C2=A0 But since I regularly have to work on files where other people hav= e been less fastidious Steve's package would not clean these electric w= hitespace messes.

I actually really like the behav= ior of the code I posted.=C2=A0 It has an added small bonus.=C2=A0 Normally= it does not cleanup pre-existing whitespace.=C2=A0 When I modify a line wi= th trailing whitespace it does cleanup that one line, something my projects= ' guidelines allow.

/john

=

--001a11c1e9ee56d99d050a86fe6c--