bug-texinfo
[Top][All Lists]
Advanced

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

Re: leading and trailing spaces in brace commands


From: Patrice Dumas
Subject: Re: leading and trailing spaces in brace commands
Date: Tue, 27 Sep 2022 09:26:15 +0200

On Mon, Sep 26, 2022 at 08:40:46PM +0100, Gavin Smith wrote:
> On Sun, Sep 25, 2022 at 04:11:13PM +0200, Patrice Dumas wrote:
> > I suggest, for texi2any
> > * not to ignore spaces for indicating brace @-commands and @w (nothing
> >   changes for those commands) and also for the following list of @-commands
> >   that are somewhat similar to indicating @-commands:
> >    U, dmn, key, indicateurl, titlefont.
> >   For @U, the objective in keeping spaces is mostly to issue an error if
> >   there are spaces (as in Texinfo TeX).
> > * to ignore spaces for the other brace @-commands
> 
> It would make sense to have consistent treatment for classes of commands
> in tp/Texinfo/XS/parsetexi/command_data.txt.  For example, all BRACE_arguments
> commands could ignore spaces, including around commas, after opening braces,
> and before closing braces.

That's exactly how it is, all BRACE_arguments ignore spaces around
commas, after opening braces, and before closing braces, as before.  But
I separated the class of command information from the number of
arguments information, so now it is possible to have more logical
classes of commands independently of the number of arguments, in
particular with respect to spaces handling, or with respect to other
logical groupings characteristics.  At that occasion I noticed that some
@-commands that were grouped together are very different, and thus I
proposed to change that, in particular when this is not consistent with
Texinfo TeX.

> It might be better, if there is an error for @U with spaces with texinfo.tex,
> to fix texinfo.tex (although not a priority), rather than have special
> treatment in texi2any.

Ok.

> I'm not sure if it would be correct to ignore spaces for other commands:
> @math, @value, @verb...  Almost every command could be different.  It
> seems quite simple to say that these spaces are ignored for BRACE_arguments
> commands but not for others, although needless to say I haven't fully
> explored the consequences of this idea by trying to implement it.

That's exactly what the implementation does currently, but my point is
that some of these cocmmands should not be in BRACE_arguments but in
another class, either one already existing, or a new one.

> > It would probably be best for Texinfo TeX to do something consistent,
> > but it may also not be worth the time involved either.  In my tests, spaces
> > seems to always be ignored around commas in Texinfo TeX, which is good,
> > trailing spaces before a closing brace are also often if not always
> > ignored, but a leading space is often output, for example for @email,
> > @abbr, and even for @shortcaption, but not for @footnote or @sortas.
> 
> It's likely a minefield with every command being slightly different.  It
> may be possible to get consistency with texi2any but I don't know how
> easy this would be.
> 
> Generally speaking I don't think it's a very important issue and I'd
> rather spend time on issues that should be resolved before the next
> release, rather than spending time on obscure use cases.

I fully agree, this is not important.

> Of course, if
> it's something you feel is worthwhile then please feel free to work on it.

Ok.  I raised a discussion on that because I am not completly sure that
this change is right, but I can decide by myself, too.

-- 
Pat



reply via email to

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