bug-texinfo
[Top][All Lists]
Advanced

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

Re: Multiline @cindex entries misrender in groff Texinfo manual


From: Gavin Smith
Subject: Re: Multiline @cindex entries misrender in groff Texinfo manual
Date: Sun, 2 Jun 2024 23:58:46 +0100

On Thu, May 16, 2024 at 10:41:44PM +0200, Patrice Dumas wrote:
> On Thu, May 16, 2024 at 02:21:21PM -0500, G. Branden Robinson wrote:
> > At 2024-05-16T12:55:51-0500, Dave Kemper wrote:
> > > In a few places, the groff Texinfo manual uses a line-ending @ to
> > > continue a @cindex entry.  An example is:
> > > 
> > >   @cindex print to the standard error stream (@code{tm}, @code{tm1},@
> > >   @code{tmc})

...

> There is a specific context in which @ followed by a newline is removed
> and the line is not considered to be ended, on the @def* command line.
> It is said explicitely in that section that in other contexts, the @
> followed by a newline is not a continuation character:
> https://www.gnu.org/software/texinfo/manual/texinfo/texinfo.html#Def-Cmd-Continuation-Lines

...

> > I suspect it's not a coincidence that DVI and PDF are the formats for
> > which texinfo uses TeX to generate the output.
> 
> Indeed, seems like @ followed by a new line does not ends the @-command
> line in Texinfo TeX.  I don't know if it should be considered as
> undefined behaviour or if TeX (or makeinfo, though I'd say that makeinfo
> is right...) should be changed.  I'd lean towards undefined behaviour in
> that case.

I agree that it is undefined behaviour.  makeinfo could flag it as an
error.  It may not be possible to modify texinfo.tex to stop reading
the line at the end of the first line for input line

@cindex aaa@
bbb

Perhaps a warning like this (of course the same change would have to
be made to the XS parser):

diff --git a/tp/Texinfo/ParserNonXS.pm b/tp/Texinfo/ParserNonXS.pm
index d39b0b14bd..a6bfab8014 100644
--- a/tp/Texinfo/ParserNonXS.pm
+++ b/tp/Texinfo/ParserNonXS.pm
@@ -5428,6 +5428,12 @@ sub _handle_other_command($$$$$)
                               $command), $source_info);
       }
       if ($command eq "\n") {
+        if ($self->_top_context() eq 'ct_line') {
+          $self->_line_warn(
+            "\@ should not occur at end of argument to line command",
+            $source_info);
+        }
+
         $current = _end_line($self, $current, $source_info);
         $retval = $GET_A_NEW_LINE;
       }



reply via email to

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