[PATCH] Remove unnecessary empty lines in article body. New feature?

Dennis Preiser <[email protected]> Sun, 5 Oct 2008 22:00:24 +0200
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
On 02.10.2008, at 12:36, Urs Janßen wrote:

> On Thu, Oct 02, 2008 at 12:17:27PM +0200, Dennis Preiser wrote:
>> So I patched my tin to behave like this:
>>
>> -remove leading empty lines
>> -replace multiple empty lines with one empty line (when not in  
>> verbatim
>> blocks)
>> -remove trailing empty lines (keep one if an attachement follows)

[...]

> If you add that option (dunno if it's a usefull feature) I would  
> suggest to
> not just make it a on/off option but allow a finer control, e.g.:
>
> 0 = off
> 1 = skip leading empty
> 2 = skip tailing empty
> 3 = skip leading and tailing empty
> 4 = compact multiple empty between textblocks
> 5 = compact multiple empty between textblocks && skip leading empty
> 6 = compact multiple empty between textblocks && skip tailing empty
> 7 = all

I have implemented this feature with the options suggested above. I  
introduced two new Option-'M'enu entrys:

How to treat empty lines:	Nothing special (default)
				Skip leading
				Skip tailing
				Skip leading and tailing
				Compact multiple between text
				Compact multiple and skip leading
				Compact multiple and skip tailing
				Compact mltpl., skip lead. & tail

and

Treat blank lines as empty:	OFF (default)
				ON

'Treat blank lines as empty' is only visible if 'How to treat empty  
lines' is set to anything else than 'Nothing special'. If 'Treat  
blank lines as empty' is not set, only lines containing nothing are  
affected by 'How to treat empty lines'. If 'Treat blank lines as  
empty' is set, lines containing any whitespace (blanks and/or tabs)  
are affected by 'How to treat empty lines'.

The following options I have not implemented yet:

> and maybe a second option which controls in which body-parts the  
> setting
> should be used:
>
> 0 = none
> 1 = body without signature (without verbatim blocks)
> 2 = signature only (without verbatim blocks)
> 3 = body & signature (without verbatim blocks)
>
> but that might be overkill.

In option_menu.c OPT_VERBATIM_HANDLING needs redraw_screen() because  
it toggles the visibility of other options. I have fixed this too.  
The patch is attached.

Regards,
Dennis
20081005-trim_article_body.diff.gz (application/x-gzip, 4.4 KB) - not displayed