I use the function TeX-parse-error defined by Ivan Andrus at the bottom of Emacs latexmk function throws me into an empty buffer in order to automatically open the *TeX Help* buffer when there was an error during the compilation (C-c C-c). After correcting an error and compiling again, the *TeX Help* buffer remains open (although the error has been corrected). Is there any way to adjust the function (unfortunately, I’m not experienced in elisp programming) so that the *TeX Help* buffer is closed if the error was resolved and updated (and still open) if the error wasn’t resolved? That would save a lot of typing like C-c ' to show the *TeX Help* buffer and C-x 1 to hide it again.
I use the function TeX-parse-error defined by Ivan Andrus at the bottom of Emacs
Share
First, let’s define a function that finds the
*TeX Help*buffer, if it exists, closes its window, and then kills the buffer:Now, you have to call this when you call whatever function it is that you use to compile. Taking the example from that other page, you can modify Ivan Andrus’s function to be:
(Note: This doesn’t actually work for me, because my latexmk is screwed up, so I haven’t successfully tested it. But if Ivan’s version worked for you, then this should too.)
So now, any time you call latexmk with this function (by hitting
C-0, for example), once the compilation is done, it checks for errors. If there were errors, it automatically opens the Help window and gets the first error. If there were none, it checks to see if the Help buffer is open; if so, it closes that window and kills the buffer.