3

For some special tex with typos, mode-line always shows [Compiling] even if we correct all typos.

To reproduce

First compile the following correct tex by C-c C-a

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\begin{document}
\begin{figure}[h]
  \centering
  \begin{tikzpicture}
    \draw[fill] (-1,0.67) circle [radius=0.03] node [above] {\small local maximum point};
  \end{tikzpicture}
  \caption{local maximum}
\end{figure}
\end{document}

Then replace the word circle by cicle and compile the wrong tex by C-c C-a. Now the minibuffer will show

error in process sentinel: epdfinfo: Error opening d:/test/aa.pdf:Failed to load document

and the mode-line will show [Compiling]

enter image description here

Now even if I correct the typo cicle, the status [Compiling] stays.

My Question: Is there some way to correct the status [Compiling] after correcting tex file except restart emacs?

allenryb
  • 51
  • 3
  • I cannot reproduce this. Try `emacs -q` to avoid loading your init file. Can you still reproduce it? If not, then something is wrong in your init file. [Bisect your init file](https://emacs.stackexchange.com/questions/13868/how-to-get-emacs-to-locate-the-error-in-my-init-file-without-relaunching) to figure out what is wrong. – NickD Nov 26 '20 at 16:55
  • 2
    I used to sometimes get similar problems when compiling C++. The solution in my case was simply to do `(setq compilation-in-progress nil)`. – stevoooo Jan 19 '22 at 15:51

1 Answers1

1

I'm not sure what causes this, but just hit myself and this was the resolution.

The compilation-in-progress entry had been added to the front of the mode-line-modes variable. In my case it was as easy as eval'ing the following

(pop mode-line-modes)

Obviously if it's in the middle of the list you want to remove that element. Using the dash library makes this easier, and you can do something like the following:

(setq mode-line-modes (-remove-at <n> mode-line-modes))
w08r
  • 111
  • 2