bug-texinfo
[Top][All Lists]
Advanced

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

Re: @r{@b{&rest}} on @defun fails


From: Gavin Smith
Subject: Re: @r{@b{&rest}} on @defun fails
Date: Fri, 29 Jul 2022 15:13:53 +0100

On Thu, Jul 28, 2022 at 02:31:57PM +0200, Patrice Dumas wrote:
> Hello,
> 
> an explicit formatting of &rest on @defun line fails:
> 
> @defun apply function @r{@b{&rest}} argument
> 
> /explicit_amp_def.texi:9: Argument of & has an extra }.
> <inserted text> 
>                 @par 
> <to be read again> 
>                    }
> @r #1->{@rm #1
>               }
> <argument> function @r {@b {&rest}}
>                                     argument @unskip 
> @defunargs ...etregularquotes @ttslanted {##1}}}#1
>                                                   @sl @hyphenchar @font =45 
> @printdefunline ...nfrenchspacing #1#2 @endheader 
>                                                   @interlinepenalty = 10000 
> ...
> l.9 @defun apply function @r{@b{&rest}} argument
>                                                 
> ? 
> 
> 
> If I add a space after &rest, it compiles, but there is an additional
> space.


I am going to commit the following fix:

diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index a1505769cf..9b6b6a35b0 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -2818,7 +2818,7 @@ end
 \let\emph=\smartitalic
 
 % Explicit font changes: @r, @sc, undocumented @ii.
-\def\r#1{{\rm #1}}              % roman font
+\def\r#1{{\stopmagicamp\rm #1}} % roman font, used for code comment
 \def\sc#1{{\smallcaps#1}}       % smallcaps font
 \def\ii#1{{\it #1}}             % italic font
 
@@ -7887,6 +7887,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
 
   \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
   \gdef\magicamp{\let&=\amprm}
+  \gdef\stopmagicamp{\let&=\&}
 }
 \let\ampchar\&
 

It won't be practical to do this for all possible font commands, but
it can be done for @r, then other commands can be nested inside @r.




reply via email to

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