Fix Bug 1057: Emacs output does not escape special characters.