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: Fri, 16 Dec 2022 15:01:06 -0800



On Fri, Dec 16, 2022 at 11:17 AM Gavin Smith <gavinsmith0123@gmail.com> wrote:
On Fri, Dec 16, 2022 at 08:40:43AM -0800, Raymond Toy wrote:
> I tried this out with my translated Scribe document for one entry.  The
> entry looks like
>
> @defun {check-region-query-size} {region}
> @defunx {Hemlock Variable} {Region Query Size} @val{30}@useindex{vr}
> description
> @end defun
>
> Other than having to use defunx for a variable, this works.  Region Query
> Size shows up in the vr index as expected.  And check-region-query-size is
> still in the fn index, as expected.
>
> It's a bit annoying that I have to use defunx for a variable, but the
> output looks nice, except that Region Query Size is marked as a Function as
> shown below.
>
> At least for my use case, @useindex helps, but other parts don't work out
> right because the pdf output still says Function instead of Variable.

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.

> Allowing defvarx after defun would work the best for my use case.
>
> I wouldn't worry about this though.  I have a reasonable workaround that is
> good enough for me.  Thanks for looking into it though!  I appreciate all
> of the work put into texinfo.

Generalising @def* has long been on the to-do list for Texinfo but we have
never been sure how to proceed.  It's good to have feedback from users
about what is useful.


--
Ray

reply via email to

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