On Mon, Oct 19, 2026 at 10:22:07PM +0100, Gavin Smith wrote:
> It certainly seems consistent to allow @U{...} as "plain text" if @AA{}
> is, as it is just another way of inserting a character.  Will you take
> care of adding @U to the list of allowed commands?

This is done.

> @U itself is not listed as contain_plain_text in tta/data/command_data.txt,
> although there is a comment:
> 
> # Parsers have specific checks for U content.

Indeed.  Though @U could probably be contain_plain_text if we wanted to
have the associated error messages.  I do no think that it matters, as
there is already a generic "superfluous argument to \@%s" if there is
anything else than text in @U.

> I looked at the commands listed with "contain_plain_text" in
> tta/data/command_data.txt.  It may not be useful very often.  You can
> imagine it would be useful inside @sortas, although for some other
> commands (@need) it would not be. Usage in other commands are dubious
> (@defindex) or potentially confusing.

If an @-command is listed with "contain_plain_text" it means that some
@-commands in it will trigger some warnings.  But there could be other
checks, 'specific' line commands, for instance have a call of
Texinfo::Common::simple_arg_text applied on their tree, and if there is
anything else than simple text, there is an error, and in addition the
argument is checked for validity if needed, for example for need:
  if (($line =~ /^(\d+(\.\d*)?)$/) or
             ($line =~ /^(\.\d+)$/)) {
'text' commands have a call to _text_contents_to_plain_text, which is
a bit more forgiving, but not much only at sign or braces commands.

> In @include, I imagine that characters with @U would have to be encoded
> to whatever we think the file system encoding is (with
> INPUT_FILE_NAME_ENCODING or similar).

In @include, @U is not allowed, there is a call to
_text_contents_to_plain_text, so only  @@, @{ and @} and associated
@atchar... and @comment.

-- 
Pat

Reply via email to