bug-ncurses
[Top][All Lists]
Advanced

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

Re: specifying tab stops using tabs


From: Nick Andrik
Subject: Re: specifying tab stops using tabs
Date: Mon, 10 Jun 2013 00:59:20 +0200

Hi Thomas,


2013/6/9 Thomas Dickey <address@hidden>:
> On Thu, Jun 06, 2013 at 06:19:32PM +0200, Nick Andrik wrote:
>> In my system, the documentation of tabs states:
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>    Implicit Lists
>>        Use a single number as an option, e.g., "-5" to set tabs at the
>> given interval (in this case 1, 6, 11, 16, 21, etc.).  Tabs are
>> repeated up to the right margin
>>        of the screen.
>>
>>        Use "-0" to clear all tabs.
>>
>>        Use "-8" to set tabs to the standard interval.
> ...
>
>> tabs 1,+5,+5,+5,+5,+5,+5,+5,+5,+5,+5,+5,+5,+5,+5,+5,+5,+5
>> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
>> *----*----*----*----*----*----*----*----*----*----*----*----*----*----*----*----
>> *     *       *       *       *       *       *       *       *       *      
>>  *       *       *       *       *       *
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> hmm - considering whether I made a mistake in documenting it...
>
> The X/Open documentation is vague in this area, and does not
> contain as much detail as Solaris's manpage.  Quoting from that:
>
>      If no tab specification is given, the default value  is  -8,
>      that  is,  UNIX system ``standard'' tabs.  The lowest column
>      number is 1.  Note:  For tabs, column 1 always refers to the
>      leftmost column on a terminal, even one whose column markers
>      begin at 0, for example, the DASI 300, DASI 300s,  and  DASI
>      450.

This is also my understanding and compatible with the -5 example, no?
I think that I have a patch to fix the code which you can find attached.
It practically starts from 1 instead of N.


> but later it contradicts itself (by omitting the case for "1+0*n"):
>
>   Repetitive
>      -n        A  repetitive  specification  requests   tabs   at
>                columns  1+n,  1+2*n,  etc.,  where n is a single-
>                digit decimal number.  Of particular importance is
>                the  value  8:   this  represents  the UNIX system
>                ``standard'' tab setting, and is the  most  likely
>                tab  setting to be found at a terminal. When -0 is
>                used, the tab stops are cleared and  no  new  ones
>                are set.

The 0 case is a special corner case in my opinion.

> Either way, the documentation is more correct than the code.

Also, one thing that I noticed is that if I specify:
$ tabs 4
and
$ tabs -4
is the same.
I would expect the first one to be equivalent to "4" and the second to
"1,+4,+4,+4,+4,..."

Thanks for your great work!
NIck

--
=Do-
N.AND

Attachment: 06-fix-implicit-lists-tabs
Description: Binary data


reply via email to

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