coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [patch] add a compact header format to pr


From: William Bader
Subject: RE: [patch] add a compact header format to pr
Date: Tue, 9 Dec 2014 17:28:36 -0500

> Date: Tue, 9 Dec 2014 20:39:58 +0000
> From: address@hidden
> To: address@hidden
> Subject: Re: [patch] add a compact header format to pr
>
> On 09/12/14 00:25, William Bader wrote:
>> The attached patch adds a --compact option to pr that creates a 2 line 
>> header and 0 line footer instead of the default 5 line header and 5 line 
>> footer.
>>
>> This allows the normal header line with the file name, date and page number 
>> without wasting 8 lines per page.
>>
>> The alternatives would be 1) re-implementing pr in awk or another scripting 
>> language or 2) running pr with an increased -l and then post-processing the 
>> output.
>>
>> I have also stored the patch at 
>> http://williambader.com/pat/coreutils-8.23.pat
>
> I'm on the fence as to whether this is needed.
> If you were to do it, you'd probably have a configurable padding?
>
> pr defaults to outputting 66 lines per page (standard line printer page size),
> and the headers are set accordingly. Therefore if changing the header/footer
> size, you'd probably also have to output correspondingly more content per 
> page.
> Also -t being enabled for -l <=10 would probably have to be adjusted down.
> Also probably best not to use a short -z option, and just go with the long 
> option.
>
> thanks for the patch,
> Pádraig.

Yes, I want to keep 66 lines per page but save paper by outputting 2 lines of 
header + 64 lines of content instead of 5 lines of header + 5 lines of footer + 
56 lines of content.

If there is a chance that the patch would be accepted, I would make any 
additional changes that you recommend, for example, adjusting the test to 
enable -t if -l is small.

Making the number of header and footer lines configurable might require three 
parameters: number of header lines above the header text, number of header 
lines below the header text, and number of footer lines.  I could do that if 
you want, but I am not sure if it would be overkill.

The standard defines the 5 line header and 5 line footer format. 
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/pr.html#tag_20_93

Regards,
William

                                          


reply via email to

[Prev in Thread] Current Thread [Next in Thread]