I hadn't thought it would be as enmeshed within doc tools, but it does seem
a doc-tool/ TeX oversight to not present author toggle, as so many
languages do indeed require no space between name and L-paren.
And here I thought it was a simple typo in a particularly conflicting piece
of doc!
You all have a great weekend, this is certainly not any level of priority,
just a tool why-dey-do-dat head scratcher.
Beers to all.

On Thu, Jun 9, 2022, 12:34 PM Gavin Smith <gavinsmith0...@gmail.com> wrote:

> On Wed, Jun 8, 2022 at 5:14 PM Eric Blake <ebl...@redhat.com> wrote:
> > And it looks like back in 2006 (commit dddcc3d9), when I updated the
> > manual to use @deffn instead of @example for prototypes (for better
> > typesetting and indexing purposes), I intentionally separated NAME
> > from ARGUMENTS, assuming that texinfo was insistent on the separation.
> >
> > On a whim, just now I tried removing the space between NAME and
> > ARGUMENTS in the .texi file, to see if the resulting info file still
> > makes sense.  In 'info', it does.  But in html, it is worse;
> > previously, things would render something like:
> >
> > Builtin: <b>define</b> <i>(name, [expansion])</i>
> >
> > now it renders something like:
> >
> > Builtin: <b>define<i>(name,</i></b> <i>[expansion])</i>
> >
> > which is unacceptable (why is the name argument bolded, when the
> > expansion argument is not).
> >
> > Maybe a texinfo expert would be able to help me come up with something
> > that does what we want, of producing typesetting that bolds the macro
> > name, but omits the space between the macro and the '(' of the
> > arguments, while still getting all of the other benefits of @deffn?
>
> This appears to be a real problem, although there isn't an easy solution.
>
> It seems that the space is hard-coded in the HTML output. It looks like
> this:
>
>         $tree = $self->gdt("\@strong{{name}} \@emph{{arguments}}", {
>                 'name' => $name,
>                 'arguments' => $arguments});
>
> With the following change, the space disappears:
>
> diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
> index 47408c480b..0c93e79200 100644
> --- a/tp/Texinfo/Convert/HTML.pm
> +++ b/tp/Texinfo/Convert/HTML.pm
> @@ -5888,7 +5888,7 @@ sub _convert_def_line_type($$$$)
>        $category_result = $self->convert_tree($category_tree)
>          if (defined($category_tree));
>        if ($arguments) {
> -        $tree = $self->gdt("\@strong{{name}} \@emph{{arguments}}", {
> +        $tree = $self->gdt("\@strong{{name}}\@emph{{arguments}}", {
>                  'name' => $name,
>                  'arguments' => $arguments});
>        } else {
>
> I've checked with texinfo.tex and there is a similar problem there.
>
> I think the best way to fix this would be if no space was necessary
> and an ( started the arguments. Document authors would choose whether
> to include the space in the source and this would be reflected in the
> output. This would avoid the need for any customization settings to be
> used with texi2any.
>
> This might be hard to implement, though, especially in TeX. It is
> complicated by the fact that ( is not always present, as in the
> example in the manual:
>
> @deffn Command forward-char nchars
> Move point forward @var{nchars} characters.
> @end deffn
>
> I will try to look at texinfo.tex to understand the code better to see
> if something can be done.
>

Reply via email to