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.
Not easily. We changed the @sortas implementation for a good reason.
In the previous implementation, we extracted the @sortas value from
an index entry in an unusual way: we diverted TeX output to a dummy
"box", and executed the contents of the index entry. This was arguably
wasteful of computing power as the typeset contents would be discarded,
but the main reason for changing away from this implementation is that
error messages from this typesetting could be sent to the log file,
even though those were irrelevant to the output:
2026-03-31 Gavin Smith <[email protected]>
Fix "Missing character" messages in log file
* doc/texinfo.tex
(\extractindexcommands, \checksortas, \checkseealso, \checkseeentry):
New. Use TeX macros to check if @sortas, @seeentry and @seealso occur
in the text of an index entry.
(\doindexsegment):
Replace implementation of the @sortas, @seeentry and @seealso commands
with call to \extractindexcommands. The problem with the old way was
that we typeset the index text inside a dummy box, which could lead to
many error messages about missing glyphs being output in the log file.
Report from Jamenson Espindula.
The problem was when using non-ASCII characters in index entries.
https://lists.gnu.org/archive/html/help-texinfo/2026-03/msg00034.html
As you know anything to do with TeX macros is not easy to implement and
as Patrice says, the input is erroneous anyway.
> I'm not convinced. The argument to `@sortas` is for the index
> generator; I would expect that the argument of `@sortas` gets handled
> in verbatim mode, i.e., it gets completely ignored by TeX except while
> writing the unsorted index file. In other words, `@` should no longer
> start a command after the outermost `@sortas` command has read its
> argument; there shouldn't occur any recursive behaviour. The only
> limitations are balanced braces, but this is necessary for other
> commands, too.
Your intuition about how @sortas works or should work doesn't match
how it is actually implemented.
> 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.
>
>
> Werner