help-texinfo
[Top][All Lists]
Advanced

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

Re: @defun and @defvr in the "same" block?


From: Raymond Toy
Subject: Re: @defun and @defvr in the "same" block?
Date: Sat, 17 Dec 2022 07:03:05 -0800



On Fri, Dec 16, 2022 at 11:31 PM Gavin Smith <gavinsmith0123@gmail.com> wrote:
On Fri, Dec 16, 2022 at 03:01:06PM -0800, Raymond Toy wrote:
> > You can do this using @deffn and @deffnx instead, at the expense of also
> > needing to specify "Function" on the first line:
> >
> > @deffn  {Function}                     {check-region-query-size} {region}
> > @deffnx {@sansserif{Hemlock} Variable} @sansserif{Region Query Size} @
> >         {@r{(initial value @code{30})}} @useindex{vr}
> > description
> > @end deffn
> >
> > (I used @sansserif to match the style of the original document although
> > this may not be what is desired.)
> >
>
> Oh, that works really well. I don't mind specifying Function.  (In fact,
> that's what I was doing until I realized there was defun.)
>
> I hadn't considered matching the original text style.  Perhaps I'll
> consider it, but the most important part was that I had a texinfo version
> that had all the information in it.
>
> When (or if) this lands in a release, I'll update the doc to use these
> features.
>
> Does @useindex have to be at the end of the line?  Could it be at the
> beginning of the next line?  Having it at the end makes an already long
> line even longer and harder to notice that we specified a different index
> for the item.

It has to be after the name of the symbol being indexed, inside the
arguments at the end of the line.  You can use a line continuation, as
in:

@deffn {Variable} fun (args) @
@useindex{vr}
description
@end deffn

[snip other examples]


This is not good to write though, so if we implement this in texi2any
and document it, then we should recommend or require that @useindex
be at the end of the line (or on the next one using an @ continuation).

Thanks for the explanation.  Putting it at the end with an @ continuation works fine for me.  I am grateful.

I notice that the maxima manual does similar things, but it smashes everything into one giant functions and variables index.  For something that has so many variables, it would be nice to have separate indices.  But that's a problem for another day....


--
Ray

reply via email to

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