Re: Generalising @def*

Gavin Smith <[email protected]>
Newsgroups gmane.comp.tex.texinfo.general
Message-ID <Y+Zv44gVLhpDAnCw@starmint>
On Fri, Feb 10, 2023 at 04:24:00PM +0100, Patrice Dumas wrote:
> I have understood that the use can use any index command, simply by
> adding it before the @deflinex, but I did not understand where the user
> definition comes in?
> 
> > \input texinfo
> > 
> > @defblock
> > @deflinex Functionoid bar (args)
> > @deflinex Monoid bar2 (args, nineyy)
> > hello
> > 
> > @end defblock
> > 
> > @bye 
> > 

The idea was that the user could define a macro to output a @deflinex
command as well as an index command.  For example,

    @defcodeindex mc

    @macro defMac{name, args}
    @mcindex \name\
    @deflinex Macroid \name\ \args\
    @end macro

    @defblock
    @defMac{macro1, (arg1@comma{} arg2)}
    @defMac{macrob, (arg4@comma{} arg5)}
    Description of @code{macro1} and @code{macrob}
    @end defblock

    @heading Macro Index

    @printindex mc

This is still not that good, though, as being able to write

    @defMac macro1 (arg1, arg2)

instead would be much better.

Maybe there could be a special-purpose macro facility for defining
new definition commands that would allow the command to be invoked
without braces.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.