util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cal: drop trailing blank line
@ 2016-05-23 21:02 Mike Frysinger
  2016-05-23 21:30 ` Bruce Dubbs
  2018-01-25  4:22 ` Mike Frysinger
  0 siblings, 2 replies; 8+ messages in thread
From: Mike Frysinger @ 2016-05-23 21:02 UTC (permalink / raw)
  To: util-linux

There's no history to be found behind this, and the comment in the
code indicates no one else knows, and it makes me angry :).

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 misc-utils/cal.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index 3e20530..479c967 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -767,9 +767,6 @@ static void yearly(const struct cal_control *ctl)
 		my_putstring("\n\n");
 	}
 	monthly(ctl);
-
-	/* Is empty line at the end year output really needed? */
-	my_putstring("\n");
 }
 
 /*
-- 
2.8.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] cal: drop trailing blank line
  2016-05-23 21:02 [PATCH] cal: drop trailing blank line Mike Frysinger
@ 2016-05-23 21:30 ` Bruce Dubbs
  2016-05-23 22:58   ` Mike Frysinger
  2018-01-25  4:22 ` Mike Frysinger
  1 sibling, 1 reply; 8+ messages in thread
From: Bruce Dubbs @ 2016-05-23 21:30 UTC (permalink / raw)
  To: Mike Frysinger, util-linux

Mike Frysinger wrote:
> There's no history to be found behind this, and the comment in the
> code indicates no one else knows, and it makes me angry :).
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>   misc-utils/cal.c | 3 ---
>   1 file changed, 3 deletions(-)
>
> diff --git a/misc-utils/cal.c b/misc-utils/cal.c
> index 3e20530..479c967 100644
> --- a/misc-utils/cal.c
> +++ b/misc-utils/cal.c
> @@ -767,9 +767,6 @@ static void yearly(const struct cal_control *ctl)
>   		my_putstring("\n\n");
>   	}
>   	monthly(ctl);
> -
> -	/* Is empty line at the end year output really needed? */
> -	my_putstring("\n");
>   }
>
>   /*

Personally I like the blank line. It sets off the cal output from the 
shell prompt making it easier to read.  It is basically adding the 
equivalent of the css property padding-bottom="1em".

I note that if doing a 'cal -y' that there is also a blank line between 
the year and February.  That should stay also.

   -- Bruce Dubbs
      linuxfromscratch.org


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] cal: drop trailing blank line
  2016-05-23 21:30 ` Bruce Dubbs
@ 2016-05-23 22:58   ` Mike Frysinger
  2016-05-23 22:59     ` Mike Frysinger
  2016-05-23 23:32     ` Bruce Dubbs
  0 siblings, 2 replies; 8+ messages in thread
From: Mike Frysinger @ 2016-05-23 22:58 UTC (permalink / raw)
  To: Bruce Dubbs; +Cc: util-linux

[-- Attachment #1: Type: text/plain, Size: 1453 bytes --]

On 23 May 2016 16:30, Bruce Dubbs wrote:
> Mike Frysinger wrote:
> > There's no history to be found behind this, and the comment in the
> > code indicates no one else knows, and it makes me angry :).
> >
> > --- a/misc-utils/cal.c
> > +++ b/misc-utils/cal.c
> > @@ -767,9 +767,6 @@ static void yearly(const struct cal_control *ctl)
> >   		my_putstring("\n\n");
> >   	}
> >   	monthly(ctl);
> > -
> > -	/* Is empty line at the end year output really needed? */
> > -	my_putstring("\n");
> >   }
> >
> >   /*
> 
> Personally I like the blank line. It sets off the cal output from the 
> shell prompt making it easier to read.  It is basically adding the 
> equivalent of the css property padding-bottom="1em".

why should cal care ?  you could make this same exact argument for any
other cli tool that displays things.  if you like that behavior, then
update your PS1 to include a leading \n.

> I note that if doing a 'cal -y' that there is also a blank line between 
> the year and February.  That should stay also.

that's a different issue.  cal always writes exactly 6 lines for a month
regardless of how many weeks a month actually uses.  it makes the code
simpler (no need to scan/remember sibling months) and the output more
consistent -- every row is 7 lines.  pick a non-leap year like 2015 and
see Feb take up only 4 lines but still leave 2 blank below it.  or pick
2019 and see Mar use all 6 lines.
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] cal: drop trailing blank line
  2016-05-23 22:58   ` Mike Frysinger
@ 2016-05-23 22:59     ` Mike Frysinger
  2016-05-23 23:32     ` Bruce Dubbs
  1 sibling, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2016-05-23 22:59 UTC (permalink / raw)
  To: Bruce Dubbs, util-linux

[-- Attachment #1: Type: text/plain, Size: 102 bytes --]

On 23 May 2016 18:58, Mike Frysinger wrote:
> consistent -- every row is 7 lines.

s/row/month/
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] cal: drop trailing blank line
  2016-05-23 22:58   ` Mike Frysinger
  2016-05-23 22:59     ` Mike Frysinger
@ 2016-05-23 23:32     ` Bruce Dubbs
  2016-05-24  1:02       ` Mike Frysinger
  1 sibling, 1 reply; 8+ messages in thread
From: Bruce Dubbs @ 2016-05-23 23:32 UTC (permalink / raw)
  To: util-linux

Mike Frysinger wrote:
> On 23 May 2016 16:30, Bruce Dubbs wrote:
>> Mike Frysinger wrote:
>>> There's no history to be found behind this, and the comment in the
>>> code indicates no one else knows, and it makes me angry :).
>>>
>>> --- a/misc-utils/cal.c
>>> +++ b/misc-utils/cal.c
>>> @@ -767,9 +767,6 @@ static void yearly(const struct cal_control *ctl)
>>>    		my_putstring("\n\n");
>>>    	}
>>>    	monthly(ctl);
>>> -
>>> -	/* Is empty line at the end year output really needed? */
>>> -	my_putstring("\n");
>>>    }
>>>
>>>    /*
>>
>> Personally I like the blank line. It sets off the cal output from the
>> shell prompt making it easier to read.  It is basically adding the
>> equivalent of the css property padding-bottom="1em".
>
> why should cal care ?  you could make this same exact argument for any
> other cli tool that displays things.  if you like that behavior, then
> update your PS1 to include a leading \n.

I certainly do not want to double space every bash prompt.  Your solution 
causes more problems than it solves.

>> I note that if doing a 'cal -y' that there is also a blank line between
>> the year and February.  That should stay also.
>
> that's a different issue.  cal always writes exactly 6 lines for a month
> regardless of how many weeks a month actually uses.  it makes the code
> simpler (no need to scan/remember sibling months) and the output more
> consistent -- every row is 7 lines.  pick a non-leap year like 2015 and
> see Feb take up only 4 lines but still leave 2 blank below it.  or pick
> 2019 and see Mar use all 6 lines.

Did you look at the output?

                                2016
---> blank line
        January               February                 March
Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa
                 1  2       1  2  3  4  5  6          1  2  3  4  5


   -- Bruce


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] cal: drop trailing blank line
  2016-05-23 23:32     ` Bruce Dubbs
@ 2016-05-24  1:02       ` Mike Frysinger
  0 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2016-05-24  1:02 UTC (permalink / raw)
  To: Bruce Dubbs; +Cc: util-linux

[-- Attachment #1: Type: text/plain, Size: 2120 bytes --]

On 23 May 2016 18:32, Bruce Dubbs wrote:
> Mike Frysinger wrote:
> > On 23 May 2016 16:30, Bruce Dubbs wrote:
> >> Mike Frysinger wrote:
> >>> There's no history to be found behind this, and the comment in the
> >>> code indicates no one else knows, and it makes me angry :).
> >>>
> >>> --- a/misc-utils/cal.c
> >>> +++ b/misc-utils/cal.c
> >>> @@ -767,9 +767,6 @@ static void yearly(const struct cal_control *ctl)
> >>>    		my_putstring("\n\n");
> >>>    	}
> >>>    	monthly(ctl);
> >>> -
> >>> -	/* Is empty line at the end year output really needed? */
> >>> -	my_putstring("\n");
> >>>    }
> >>>
> >>>    /*
> >>
> >> Personally I like the blank line. It sets off the cal output from the
> >> shell prompt making it easier to read.  It is basically adding the
> >> equivalent of the css property padding-bottom="1em".
> >
> > why should cal care ?  you could make this same exact argument for any
> > other cli tool that displays things.  if you like that behavior, then
> > update your PS1 to include a leading \n.
> 
> I certainly do not want to double space every bash prompt.  Your solution 
> causes more problems than it solves.

if you want to special case `cal` or any other util, then alias it in
your shell.  your personal preference for a util doesn't mean it should
stay that way.  the trailing newline is uncommon in the cli world.

> >> I note that if doing a 'cal -y' that there is also a blank line between
> >> the year and February.  That should stay also.
> >
> > that's a different issue.  cal always writes exactly 6 lines for a month
> > regardless of how many weeks a month actually uses.  it makes the code
> > simpler (no need to scan/remember sibling months) and the output more
> > consistent -- every row is 7 lines.  pick a non-leap year like 2015 and
> > see Feb take up only 4 lines but still leave 2 blank below it.  or pick
> > 2019 and see Mar use all 6 lines.
> 
> Did you look at the output?

i thought you were talking about the inter-month spacing.  i don't care
about either of those, nor does my change impact them.
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] cal: drop trailing blank line
  2016-05-23 21:02 [PATCH] cal: drop trailing blank line Mike Frysinger
  2016-05-23 21:30 ` Bruce Dubbs
@ 2018-01-25  4:22 ` Mike Frysinger
  2018-01-25 11:26   ` J William Piggott
  1 sibling, 1 reply; 8+ messages in thread
From: Mike Frysinger @ 2018-01-25  4:22 UTC (permalink / raw)
  To: util-linux

[-- Attachment #1: Type: text/plain, Size: 720 bytes --]

On 23 May 2016 17:02, Mike Frysinger wrote:
> There's no history to be found behind this, and the comment in the
> code indicates no one else knows, and it makes me angry :).
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
>  misc-utils/cal.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/misc-utils/cal.c b/misc-utils/cal.c
> index 3e20530..479c967 100644
> --- a/misc-utils/cal.c
> +++ b/misc-utils/cal.c
> @@ -767,9 +767,6 @@ static void yearly(const struct cal_control *ctl)
>  		my_putstring("\n\n");
>  	}
>  	monthly(ctl);
> -
> -	/* Is empty line at the end year output really needed? */
> -	my_putstring("\n");
>  }
>  
>  /*
> -- 
> 2.8.2

ping ...
-mike

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] cal: drop trailing blank line
  2018-01-25  4:22 ` Mike Frysinger
@ 2018-01-25 11:26   ` J William Piggott
  0 siblings, 0 replies; 8+ messages in thread
From: J William Piggott @ 2018-01-25 11:26 UTC (permalink / raw)
  To: util-linux



On 01/24/2018 11:22 PM, Mike Frysinger wrote:
> On 23 May 2016 17:02, Mike Frysinger wrote:
>> There's no history to be found behind this, and the comment in the
>> code indicates no one else knows, and it makes me angry :).
>>
>> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>> ---
>>  misc-utils/cal.c | 3 ---
>>  1 file changed, 3 deletions(-)
>>
>> diff --git a/misc-utils/cal.c b/misc-utils/cal.c
>> index 3e20530..479c967 100644
>> --- a/misc-utils/cal.c
>> +++ b/misc-utils/cal.c
>> @@ -767,9 +767,6 @@ static void yearly(const struct cal_control *ctl)

Hi Mike,

If Karel accepts it, yearly() is removed completely in my last submission:
  [PATCH 2/4] cal: remove year top header


>>  		my_putstring("\n\n");
>>  	}
>>  	monthly(ctl);
>> -
>> -	/* Is empty line at the end year output really needed? */
>> -	my_putstring("\n");
>>  }
>>  
>>  /*
>> -- 
>> 2.8.2
> 
> ping ...
> -mike
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-01-25 11:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-23 21:02 [PATCH] cal: drop trailing blank line Mike Frysinger
2016-05-23 21:30 ` Bruce Dubbs
2016-05-23 22:58   ` Mike Frysinger
2016-05-23 22:59     ` Mike Frysinger
2016-05-23 23:32     ` Bruce Dubbs
2016-05-24  1:02       ` Mike Frysinger
2018-01-25  4:22 ` Mike Frysinger
2018-01-25 11:26   ` J William Piggott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).