[Top][All Lists]

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

Re: ampersand issue with texi2dvi

From: Gavin Smith
Subject: Re: ampersand issue with texi2dvi
Date: Thu, 6 Sep 2018 20:46:57 +0100
User-agent: Mutt/1.5.23 (2014-03-12)

On Thu, Sep 06, 2018 at 09:52:13PM +0300, Eli Zaretskii wrote:
> The point is to support optional arguments to Lisp functions, like
> this:
>   @defun set-input-mode interrupt flow meta &optional quit-char
> and also like this:
>   @defun notifications-notify &rest params
> You can see such examples all over the Emacs Lisp Reference manual
> that comes with Emacs.
> If we can distinguish & followed by a letter from everything else,
> this problem can be fixed, I think.

There is also something in there about putting text in brackets in bold 
and possibly changing the font used for the bracket characters 
themselves. I don't know what that is all about.

But the basic problem seems simple enough to understand. When an 
ampersand is seen, it is interpreted as a macro with the argument the 
text up to the next space. Brace characters can delimit macro arguments
in TeX and &} is non-sensical. In @code{aaa&} the argument of & has to 
be nested within the argument of @code but the closing space is not 
seen.  If only there was some way to take the argument up to the next 
space OR the next closing brace.

I can't think of a simple solution. The only thing that comes to mind is 
to change the definition of & inside any arguments to commands in a @def 
line but this would be hard to do for every single Texinfo command. Or 
perhaps there could be some preprocessing of an entire @def line at once 
to replace the & at the top level with a control sequence. Or inserting 
extra tokens into the line that will be interpreted later somehow.

reply via email to

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