mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Isaacson <adi@hexapodia.org>
To: Josh Triplett <josh@kernel.org>, Dave Young <hidave.darkstar@gmail.com>
Cc: Jan Engelhardt <jengelh@computergmbh.de>,
	Chris Shoemaker <c.shoemaker@cox.net>,
	Josh Triplett <josht@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	Li Yang-r58472 <LeoLi@freescale.com>
Subject: Re: [PATCH] CodingStyle: Add information about trailing whitespace.
Date: Thu, 28 Jun 2007 19:03:02 -0700	[thread overview]
Message-ID: <20070629020302.GB16986@hexapodia.org> (raw)
In-Reply-To: <a8e1da0706280020ocf81ce7u98de87f16d674706@mail.gmail.com> <46835C16.9020700@kernel.org>

On Wed, Jun 27, 2007 at 11:58:30PM -0700, Josh Triplett wrote:
> Jan Engelhardt wrote:
> > On Jun 28 2007 06:29, dave young wrote:
> >> IMHO, another  cause of trailing whitespace is human error, for
> >> example long lines breaking will easy to cause the first line with one
> >> traling whitespace (original space between the last two words).
> > 
> > Most common errors (to me) are:
> > 
> >  - hit return+tab too quickly that it interchanges, hence producing
> >    the unwanted \t\n
> >  - hit return+return to start a new paragraph of code;
> >    the intermediate line remains indented if autoindent is on.
> 
> Interestingly, emacs gets that case right: when you hit enter it places the
> cursor at the properly indented insertion point, but if you leave the line
> without typing anything it does not leave the indentation.  I thought I
> remembered vim doing the same thing, but I just tested and it appears not.  It
> seems to avoid leaving subsequent lines indented, but not the first one.

I've previously found that vim's "cindent" mode is better than
"smartindent", which is better than "autoindent".  However, as of vim
6.3 autoindent seems to be fairly well off; the following does TRT:
`int SPC foo() RET { RET C-t int SPC x; RET RET foo(); RET'
(leaving an empty line between "int x;" and "foo();").  However, the
following does leave a line matching /^ +$/ even in smartindent and
cindent modes:
`int SPC foo() RET { RET int SPC x; RET SPC BS bar(); RET'
that is, if you edit the autoindented line before leaving it blank, then
vim 6.3 will not remove the autoindent spaces when you leave the line.

-andy

  parent reply	other threads:[~2007-06-29  2:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-27 17:59 Josh Triplett
2007-06-27 18:05 ` Chris Shoemaker
2007-06-27 18:17   ` Josh Triplett
2007-06-27 19:32     ` Chris Shoemaker
2007-06-27 22:18   ` Jan Engelhardt
2007-06-28  6:00     ` dave young
2007-06-28  6:08       ` Josh Triplett
2007-06-28  6:29         ` dave young
2007-06-28  6:52           ` Jan Engelhardt
2007-06-28  6:58             ` Josh Triplett
2007-06-28  7:08               ` Li Yang-r58472
2007-06-28  7:10                 ` Dave Young
2007-06-28  7:20                   ` Dave Young
2007-06-29  3:11                     ` [OT] Vim highlighting for trailing spaces Kyle Moffett
2007-06-29  7:39                       ` Jan Engelhardt
2007-06-29  7:53                         ` Josh Triplett
2007-06-29  8:01                           ` Jan Engelhardt
2007-06-29  8:42                             ` Josh Triplett
2007-06-29  9:21                               ` Björn Steinbrink
2007-06-29  9:26                                 ` Dave Young
2007-06-29 12:40                       ` Michael Tokarev
2007-06-29 12:49                         ` Dmitry Torokhov
2007-06-30  0:00                           ` Kyle Moffett
2007-06-29  2:03               ` Andy Isaacson [this message]
2007-06-27 19:31 ` [PATCH] CodingStyle: Add information about trailing whitespace Andrew Morton
2007-06-27 22:14   ` Jan Engelhardt
2007-06-27 22:14   ` Oleg Verych

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070629020302.GB16986@hexapodia.org \
    --to=adi@hexapodia.org \
    --cc=LeoLi@freescale.com \
    --cc=akpm@linux-foundation.org \
    --cc=c.shoemaker@cox.net \
    --cc=hidave.darkstar@gmail.com \
    --cc=jengelh@computergmbh.de \
    --cc=josh@kernel.org \
    --cc=josht@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®