Util-Linux package development
 help / color / mirror / Atom feed
From: "Pádraig Brady" <P@draigBrady.com>
To: Karel Zak <kzak@redhat.com>
Cc: Christian Schlotter <schlotter@users.sourceforge.net>,
	util-linux-ng@vger.kernel.org
Subject: Re: [PATCH] cal: Output unaligned with "-3" option and libtermcap
Date: Thu, 15 Feb 2007 15:03:51 +0000	[thread overview]
Message-ID: <45D47657.70006@draigBrady.com> (raw)
In-Reply-To: <20070215144938.GI3925@petra.dvoda.cz>

Karel Zak wrote:
> On Thu, Feb 15, 2007 at 01:31:20PM +0000, Pádraig Brady wrote:
>> Karel Zak wrote:
>>>  Hi Christian,
>>>
>>>  some ideas from your patch are really good, but the rest is not so
>>>  perfect after all.
>> Sorry I missed the original mail/patch.
>> Can you send again?
> 
>  Done.
> 
>> For reference I did the "highlight today" functionality
>> in cal a couple of years back which has alignment issues,
>> and have been trying to get the fix in since then:
>> http://www.pixelbeat.org/patches/cal-2.12q-highlight.diff
> 
>  This patch is already in my mail box ;-)
> 
>  Well, Christian's patch is more about code refactoring rather than
>  about simple bug fix only. (It might good idea to cleanup the code.)

Yes the code can definitely be refactored.
I was wary of changing format though when I looked at it,
in case I broke scripts depending on whitespace etc.

> 
>> Incidentally I also fixed the weekday alignment for
>> multibyte locales in the changes I did a couple of years ago
> 
>  There is also other multibyte fix (by RH):
> 
>      http://people.redhat.com/kzak/util-linux/util-linux-2.12p-cal-wide.patch
> 
>  My plan is write some regression tests for the "cal" before playing
>  with these patches.

I used the following 2 scripts to test my changes:

[ ! -e "./cal" ] && CAL=cal || CAL=./cal
LANG=ga_IE.utf8 $CAL -3 11 2004 #truncation (first month)
LANG=zh_HK.utf8 $CAL -3         #multibyte centering
$CAL | cat  #no highlight
TERM= $CAL  #no highlight
TERM=vt100 $CAL  #highlight, with characters to be stripped by putp
$CAL -y | head | tr ' ' . #3 spaces between cols?
$CAL -3 | tr ' ' .        #2 spaces between cols and trailing spaces?


locale -a |
grep utf8 |
uniq -w2 |
while read LANG; do
    cal -3 |
    head -2 | tail -1;
done


Pádraig

      reply	other threads:[~2007-02-15 15:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <45868535.5030402@users.sourceforge.net>
2007-02-15 13:03 ` [PATCH] cal: Output unaligned with "-3" option and libtermcap Karel Zak
2007-02-15 13:31   ` Pádraig Brady
2007-02-15 14:18     ` Karel Zak
2007-02-15 15:04       ` Pádraig Brady
2007-02-15 14:49     ` Karel Zak
2007-02-15 15:03       ` Pádraig Brady [this message]

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=45D47657.70006@draigBrady.com \
    --to=p@draigbrady.com \
    --cc=kzak@redhat.com \
    --cc=schlotter@users.sourceforge.net \
    --cc=util-linux-ng@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