Auctex 的 mode-line 一直显示 [Compiling]

Auctex 在特殊情形下,mode-line 一直显示 [Compiling],无论是否修改好错误。

重现方法: 编译一次如下正确的 tex

\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}

再将 circle 故意拼错成 cicle,再编译一次,这时 ·mode-line 中就会一直显示 [Compiling]。 即使我将改错误修改回来,也会显示 [Compiling]。

请问下,是否有方法可以在不重启 emacs 的情形下,让 mode-line 正确显示。

我觉得是你的latex设置有问题, cicle编译会报错,然后pdflatex会等待你输入,然后Emacs没有收到pdflatex的返回,所以一直显示compiling

我的设置是这样的

(use-package auctex 
  :ensure t 
  :hook ((LaTeX-mode . LaTeX-math-mode)
	 ((LaTeX-mode BibTeX-mode) . visual-line-mode))
  :init
  (setq TeX-auto-save t) 
  (setq TeX-parse-self t)
  (setq-default TeX-master t)
  (setq font-latex-fontify-script nil
	LaTeX-default-environment "align"
	LaTeX-math-abbrev-prefix (kbd ";")
	TeX-save-query nil
	TeX-insert-braces nil
	TeX-debug-bad-boxes t
	LaTeX-using-Biber t)
  (setq TeX-source-correlate-method (quote synctex)
	TeX-source-correlate-mode t
	TeX-source-correlate-start-server t)

  (setq TeX-view-program-selection '((output-pdf "PDF Tools")))

  (add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)

  (add-hook 'LaTeX-mode-hook
      (lambda ()
	(TeX-add-symbols '("textbf" 1)
			 '("subsection" 1)
			 '("section" 1)
			 '("xlongequal" 1)
			 '("displaystyle")
			 '("leavevmode"))))
  (setq LaTeX-math-list
	'(("o d" "dots" "Punctuation")
	  ("i" "iota" "Greek Lowercase" 953)
	  ("o w" "wedge" "Binary Op" 8743)
	  ("q" "theta" "Greek Lowercase" 952)
	  ("c" "chi" "Greek Lowercase" 967)
	  ("o s" "sum" "Var Symbol" 8721))))

修改完 TeX 文件之后再编译一次.

这是 auctex 设计的问题。abo-abo 也在mailing list 上问过,在配置中添加

(setq compilation-in-progress nil)

就可以解决这个问题。

在配置中添加对好像没用。 但是可以在编译 tex 出错后,运行该命令,可以结束 compilation,从而 [Compiling] 的状态会消失