emacs: minor fixes in error reporting functions