help-texinfo
[Top][All Lists]

## Re: simple doc point

 From: Gavin Smith Subject: Re: simple doc point Date: Thu, 9 Jun 2022 19:26:10 +0100

On Thu, Jun 9, 2022 at 6:34 PM Gavin Smith <gavinsmith0123@gmail.com> wrote:
> 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...

As I thought, it would be pretty impossible to implement in TeX in any
reasonable way. The @deffn comes to a macro:

% \deffngeneral {subind}category name args
%
\dosubind{fn}{\code{#3}}{#1}%
\defname{#2}{}{#3\magicamp}\defunargs{#4\unskip}%
}

It's the space character after "#3" that means that the name is
terminated by a space. I don't know of any easy way to terminate a
macro argument with either a space or another given character (open
bracket "(" in this case). Various possibilities come to mind,
including using active definitions of characters, avoiding capturing
the whole line as an argument in one go, or making new \def's instead
of capturing an argument, but I don't have a clear idea of how it
would work and even if it did work, would likely be horrendously
complicated. As it is, the code for @def* in texinfo.tex is already
pretty hard to understand.

It's probably best not to try to bend TeX too much, and stick to basic
affordances. This means keeping space as delimiting parts of a @def*
line.

My preferred solution for this at the moment is to add a new command,
akin to @deftypefnnewline, which would toggle whether a space was
output after the definition name. It would be included in Texinfo
source files if required. This would be fairly straightforward to
implement. In texinfo.tex, the space is output in \defname, and this
could easily be made conditional:

diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index a2bcf60e49..c742b63583 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -7835,7 +7835,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
\fi           % no return type
#3% output function name
}%
-  {\rm\enskip}% hskip 0.5 em of \rmfont
+  %\rm\enskip}% hskip 0.5 em of \rmfont
%
\boldbrax
% arguments will be output next, if any.

Does anyone have any comments?



reply via email to