Re: [PATCH 1/3] print_wrapped_text(): allow hard newlines
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Sep 25, 2009, 08:21 UTC
- Message-ID
- <alpine.DEB.1.00.0909251018200.4985@pacific.mpi-cbg.de>
- In-Reply-To
- <alpine.LFD.2.01.0909231659010.3303@localhost.localdomain>
Hi,
On Wed, 23 Sep 2009, Linus Torvalds wrote:
Show 16 quoted lines
> On Wed, 23 Sep 2009, Johannes Schindelin wrote:
> >
> > print_wrapped_text() will insert its own newlines. Up until now, if
> > the text passed to it contained newlines, they would not be handled
> > properly (the wrapping got confused after that).
> >
> > The strategy is to replace a single new-line with a space, but keep
> > double new-lines so that already-wrapped text with empty lines between
> > paragraphs will be handled properly.
>
> May I suggest doing this _only_ if the newline is followed by an
> alphanumeric characer?
>
> If the thing is indented ("newline + space") or quoted ("newline + ">"
> or whatever) then reflowing it is likely wrong and will result in an
> unholy mess.After further consideration, I decided to heed your advice; it is an obvious improvement when comparing the output with and without the isalnum().
So I updated my log-rewrap branch:
http://repo.or.cz/w/git/dscho.git?a=shortlog;h=refs/heads/log-rewrap
Thanks, Dscho