Replace unneeded sprintfs with print

* admin/unidata/emoji-zwj.awk: Printing strings doesn't need sprintf,
so just use print and string concatenation.
This commit is contained in:
Robert Pluim 2023-06-05 13:12:08 +02:00
parent daf7902ed9
commit 0485955f5a

View file

@ -83,31 +83,29 @@ END {
trigger_codepoints[12] = "1F575"
trigger_codepoints[13] = "1F590"
printf "(setq auto-composition-emoji-eligible-codepoints\n"
printf "'("
print "(setq auto-composition-emoji-eligible-codepoints"
print "'("
for (trig in trigger_codepoints)
{
printf("\n?\\N{U+%s}", trigger_codepoints[trig])
print "?\\N{U+" trigger_codepoints[trig] "}"
}
printf "\n))\n\n"
print "))"
# We add entries for 'codepoint U+FE0F' here to ensure that the
# code in font_range is triggered.
for (trig in trigger_codepoints)
{
codepoint = trigger_codepoints[trig]
c = sprintf("\\N{U+%s}", codepoint)
vec[codepoint] = vec[codepoint] "\n\"" c "\\N{U+FE0F}\""
vec[codepoint] = vec[codepoint] "\n\"\\N{U+" trigger_codepoints[trig] "}\\N{U+FE0F}\""
}
print "(dolist (elt `("
for (elt in ch)
{
entries = vec[elt] sprintf("\n\"\\N{U+%s}\\N{U+FE0E}\"\n\"\\N{U+%s}\\N{U+FE0F}\"", elt, elt)
printf("(#x%s .\n,(eval-when-compile (regexp-opt\n'(\n%s\n))))\n", elt, entries)
print "(#x" elt " .\n,(eval-when-compile (regexp-opt\n'(\n" vec[elt]
print "\"\\N{U+" elt "}\\N{U+FE0E}\"\n\"\\N{U+" elt "}\\N{U+FE0F}\"\n))))"
}
print "))"
print " (set-char-table-range composition-function-table"