syntax: texinfo: colorize the special @-plus-punctuation commands too

Also, allow an @} and another @command{} within a pair of braces,
colorize only the valid @-commands with uppercase in their names,
unbold enclosed command arguments, colorize the directory entries
for the manual, and properly colorize also the comments that use
the full @comment command.

Reference:
  https://www.gnu.org/software/texinfo/manual/texinfo/html_node/Command-List.html

Testing was done with:
  info texinfo @-C "Command List" --output=list
  sed -i -e "s/^'//" -e "s/'$//" list
  nano list -Ytexinfo
master
Benno Schulenberg 2021-10-15 17:24:18 +02:00
parent 36e3284979
commit badf3edc55
1 changed files with 10 additions and 3 deletions

View File

@ -8,17 +8,24 @@ header "^\\input texinfo"
magic "Texinfo source" magic "Texinfo source"
comment "@c " comment "@c "
# How the manual gets listed in the directory node.
color purple start="^@direntry" end="^@end direntry"
# Command arguments, trailing and enclosed. # Command arguments, trailing and enclosed.
color cyan "^@[a-z]+[[:space:]]+.*" color cyan "^@[a-z]+[[:space:]]+.*"
color brightmagenta "@[a-zA-Z]+\{[^}]*\}" color lightmagenta "@([a-z]+|,|H|U)\{([^}]|@\}|@[a-z]+\{[^}]*\})*\}"
# Commands themselves. # Commands themselves.
color yellow "@[a-zA-Z]+\{?|\}" color yellow "@([a-z]+\{?|[,HU]\{|(AA|AE|DH|L|OE?|(La)?TeX|TH)\{)|\}"
color pink "@[!"'&*./:=?@\^`{}~-]"
# Special separator for headings and footings.
color mint "@\|"
# Menu items. # Menu items.
color brightred "^\*[[:space:]]+.*::.*" color brightred "^\*[[:space:]]+.*::.*"
# Comments. # Comments.
color green "@c[[:space:]]+.*" color green "@c(omment)?[[:space:]]+.*"
# Trailing whitespace. # Trailing whitespace.
color ,green "[[:space:]]+$" color ,green "[[:space:]]+$"