[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: @defun and @defvr in the "same" block?
From: |
Gavin Smith |
Subject: |
Re: @defun and @defvr in the "same" block? |
Date: |
Fri, 16 Dec 2022 19:17:16 +0000 |
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.)
> 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.