New extension posted at Github: Indefinite Article Substitution Fix.
The idea behind the extension is to fix the bug (or behavior) where the rules for printing the name of something get called twice when the name is printed with the default indefinite article, once for the purposes of determining whether to print “a/an” and again to actually print the name. This messes up cycling and random text substitutions, as described in this bug report.
The extension takes care of this by caching the text produced the first time the rules are called (to determine whether to print a/an) and, when it comes time to actually print the name, printing the cache instead of calling the printing the name of activity again.
It should work just by being included, without the author having to do anything else.
One limitation is that it can’t handle the more outré Unicode characters (those outside group (a) in Writing with Inform §5.10), because the buffers that the text gets cycled through can’t handle those characters. Also, since it involves a bunch of I6 template hacking and I don’t really understand the I6 template, there may be other issues; let me know if you encounter anything. (Pretty soon, it’ll probably be better to use the direct e-mail in the extension documentation rather than PMing me on the forum.)
Thanks to Daniel Fremont for invaluable assistance with the I6 problems I was encountering, to Taryn Michelle for writing Print Stage Detection which I borrowed a lot of ideas from, and Natrium for pointing me to Print Stage Detection. (Natrium, if you want me to use your real name in the acknowledgments let me know; I got it wrong the first time!)