bug-texinfo
[Top][All Lists]
Advanced

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

Re: ignoring control characters in character width


From: pertusus
Subject: Re: ignoring control characters in character width
Date: Wed, 6 Sep 2023 17:35:35 +0200

On Wed, Sep 06, 2023 at 02:53:35PM +0300, Eli Zaretskii wrote:
> > From: Gavin Smith <gavinsmith0123@gmail.com>
> > Date: Wed, 6 Sep 2023 02:51:47 +0100
> > 
> > On Tue, Sep 05, 2023 at 09:16:47PM +0200, Patrice Dumas wrote:
> > > I think I understand what you don't understand, actually this is not
> > > about displaying the characters, which is not really done by texi2any,
> > > it is about situations where we need to count the width of characters
> > > in texi2any.  For instance, this is to determine when to put end of
> > > lines when formatting Info to compare with line width, or to format
> > > multitable cells, or to determine the length of underlining * for a
> > > heading string as in 
> > > 
> > > Some heading
> > > ************
> > > 
> > > Hope that it is clearer.
> > 
> > It would be wrong to output control characters in Info output.  It doesn't
> > matter what the program does in this situation as it would mean that
> > something wrong is happening somewhere else, e.g. malformed input.  Worrying
> > about what we should do for vertical tabs or form feeds is a waste of time
> > in my opinion.
> > 
> > So it doesn't matter what width is used for these characters, so we
> > should do whatever is simplest in this part of the code.  Using 0 for
> > the width seems as good as any choice.
> 
> Well, if you say that we should never-ever display these characters,
> then obviously zero is a good value.
> 
> But is it really true that we never display any of them?  Not even
> TAB?

In some contexts it is ok to have TAB, and we display them, but these
are contexts where the width does not matter, namely in @verbatim and
probably @example blocks.

In all the contexts where the width could matter, there should not be
any TAB, we display them but make no promise about the output.  In the
Conventions node in the Texinfo manual, there is:

     Other ASCII whitespace (tab, carriage return) may be
     treated the same as space characters, although the results may
     differ depending on output format.  Hence, there is not much point
     in using these in documents. ...

     However, in verbatim modes, for example in code samples, tab
     characters may produce the correct formatting in the output.

-- 
Pat



reply via email to

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