# Strange behaviour debugging a document with AUCTeX-GNUEmacs in math mode

When I try to compile this document

\documentclass{article}
\usepackage{amsmath}

\begin{document}
A simple fraction with an error $\frac{a}{b$
\end{document}

I obviously get an error because there is a missing } in the fraction and then the minibuffer says:

LaTeX errors in *c:/Program Files/emacs-23.3/bin/debug_error output*'. Use C-c  to display.

So I press C-c ` and then the windows splits in half and I have two buffers: the lower is the expected TeX Help buffer and the upper is a strange empty buffer called MiKTeX 2.8 in Nroff mode. I also noticed that this happens when there are errors in math commands or something like that.

How to prevent the MiKTeX 2.8 buffer appear? It would be nice to have a workaround.

EDIT: After reading the documentation I found this:

C-c ‘ should always stay in the current window, also when it finds a new file.

-

Invoking latex with -file-line-error-style will fix most of these problems. Your example, however, it will not. You can read the discussion on this Stack Overflow answer. One work around mentioned there is to change what file is the default to be the master file. That way when latex can't say what file the error was in, then AUCTeX will assume it was in the file you are editing. I suspect this will be right over 90% of the time, and extremely confusing the rest. :-)