On Mon, Oct 12, 2026 at 06:53:38PM +0200, Patrice Dumas wrote:
> On Mon, Oct 12, 2026 at 06:42:46PM +0200, Patrice Dumas wrote:
> > I would be in favor of always using control characters, to avoid name
> > clash, but more importantly, to mark it as an Info format generated
> > feature.
>
> What about \x{7F}\x{08} for the quoting? It reuses already used characters,
> which is good, and those characters cannot appear here (having a \x{7F}
> right after the Ref: would mean an empty node, which is not possible in
> a tag table, and \x{08} would disambiguate even this situation).
> Something else could be used too, but we should not use NUL, it is a
> pain, and probably avoid \x{1F} as it is already used to delimitate
> sections of the tag table.
I agree we shouldn't use NUL or \x{1F}. I actually don't like \x{7F}\x{08}
because of how it appears when it would be printed to the terminal:
"Ref: \x{7F}\x{08}Index cp" would print as "Ref:Index cp" with the space after
the colon disappearing. (It's similar to how to the index marker
^@^H[index^@^H] prints as "[inde]" - see the output of
"head -n 50 texinfo.info-4" in a terminal, for example.)
I doubt that \x{7F} would work well as this is separates the offset from
the anchor name and so it's likely that an Info reading program wouldn't
be able to read an anchor name containing this byte. Indeed, I've tested
that with a recent development version of Info, a line like
Ref: ^?Index cp^?894490
in the tag table of the file stops the manual being loaded at all (^? is
the 7F byte).
There's not really a right or wrong answer to this question. The anchor
name can show up in the Info browser - if the user tab-completes after
typing the 'g' command, for example, so this shouldn't be too broken if
the Info browser doesn't have special support.
I checked with a line like:
Ref: ^HIndex cp^?894490
(i.e. with a special marker SPC BS) this shows up in the tab completion
in standalone Info after the 'g' command as "^HIndex cp" at the start
of the list. The leading space appears to be skipped when getting the
anchor name - so probably using a leading space isn't a good idea for this.
Another idea is to use some other control character, somewhat at random.
"Ref: ^XIndex cp" for example. ^X doesn't appear to do anything when
printed to a terminal, so this prints as "Ref: Index cp" if dumped to
a terminal. In Info, after typing "g TAB", "^XIndex cp" is listed at
the top of the completions pane, and you can select it by typing
"^Q^XIndex cp RET". Emacs seems to work the same way.
So I think using a "^X" byte prefix would be ok. I'm also happy with
the idea of not using a control character at all in the anchor name.