Fix bug in emacs mode's handling of open thyname.

Problem arose if the thyname included the string "_fun_".
Thanks to Magnus for the bug report.

You will need to do a fresh ML < tools/smart-configure.sml
to get the new version of the Emacs mode created.
Travis: try to capture some more examples in our automatic builds