On Sun, Oct 11, 2026 at 06:19:58PM +0000, Werner LEMBERG wrote:
>
> Please consider the following input.
>
> ```
> \input texinfo
>
> @macro funindex {TEXT}
> @findex @sortas{\TEXT\ X}\TEXT\
> @c
> @end macro
>
> xxx
> @funindex aaa
> @funindex ccc
> @funindex @sortas{bbb}ddd
> yyy
>
> @printindex fn
>
> @bye
> ```
>
> With `texinfo.tex` version 2025-07-31.19, this worked; I get the
> output 'xxx yyy', and 'ddd' is sorted as 'bbb'.
>
> However, with version 2026-10-10.09, this fails: I get 'xxx
> bbbdddyyy', and 'ddd' is sorted as-is.
>
> Is it possible to restore the previous behaviour? It's a gray area
> since the documentation doesn't mention multiple calls of `@sortas` in
> a single index entry. Note, however, that both info and HTML output
> of current git (and texinfo 7.1) do the 'right' thing, i.e., they do
> the same as `texinfo.tex` version 2025-07-31.19 – the last `@sortas`
> wins.
Here there are not only two @sortas, but also nested @sortas, the
expanded Texinfo code (expanded by texi2any) is like:
@findex @sortas{@sortas{bbb}ddd X}@sortas{bbb}ddd
texi2any warns about this, rightly in my opinion:
sortas_sortas.texi:13: warning: @sortas should not appear in @sortas (possibly
involving @funindex)
sortas_sortas.texi:13: warning: @sortas should only appear in an index entry
(possibly involving @funindex)
My feeling is that if Texinfo TeX is broken by this input it is not
really a problem.
If there are two @sortas in one index entry, like
@findex @sortas{first} cc @sortas{second}
texi2any does not warn and use the second to sort, as you said. I have
no problem with not warning, however, what is used for sorting should be
considered to be undefined, could be the first @sortas, the second one,
both together, none at all.
For this construct, I think that it would be better if Texinfo TeX
gave some output, but in my testing it does.
--
Pat