Emacs 在 TeX 檔案上使用 AUCTeX 載入速度慢

Emacs 在 TeX 檔案上使用 AUCTeX 載入速度慢

我在兩台 Xubuntu 14.04 電腦上安裝了auctexemacs軟體包,兩台電腦都正常運作。 Emacs 本身在兩者上都工作得很好,但現在auctex安裝了軟體包後,當我加載 TeX 文件(即使只是一個空文件)時,我有六秒的加載時間auctex,每次加載TeX 文件時我都必須經歷這過程。

這是正常的嗎?

如果沒有,我可以做什麼來減少這個時間?

我在互聯網上搜索過,但沒有發現任何結果,只是文件解析可能需要很長時間,但事實並非如此,因為我啟用了保存和加載解析文件的功能。

我正在使用 Emacs 24 和 AUCTeX 11.87

*messages*編輯:對於新開啟的 TeX 文件,緩衝區的輸出如下所示:

("emacs" "hi.tex")
Loading 00debian-vars...done
Loading /etc/emacs/site-start.d/50auctex.el (source)...
Loading /usr/share/emacs/site-lisp/auctex.el (source)...done
Loading /usr/share/emacs/site-lisp/preview-latex.el (source)...done
Loading /etc/emacs/site-start.d/50auctex.el (source)...done
Loading /etc/emacs/site-start.d/50autoconf.el (source)...done
Loading /etc/emacs/site-start.d/50cmake-data.el (source)...done
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Error while loading 50dictionaries-common: Symbol's value as variable is void: debian-aspell-only-dictionary-alist
Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...
Loading cjk-enc...done
Loading /etc/emacs/site-start.d/50latex-cjk-common.el (source)...done
Loading /etc/emacs/site-start.d/50latex-cjk-thai.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
(New file)
Applying style hooks... done
exchange-point-and-mark: No mark set in this buffer [6 times]
exchange-point-and-mark: No mark set in this buffer

答案1

LaTeX/P 是 PDF 小模式下的 LaTeX 模式。我從來沒有遇到過 AUCTeX 的問題(而且我從 emacs v22 開始就使用它),所以我真的不認為 AUCTeX in se 是你的問題。

當您使用 -q 啟動 emacs 時,它不會載入任何初始化檔案。有關更多信息,請參閱文檔。

如果您使用的是 Linux,我會嘗試從原始程式碼重新安裝 emacs。我從來不相信軟體包儲存庫能夠真正運作。 (大部分不信任來自於已經使用了四年多的 TeX 軟體包。)如果您使用的是 windoze,請從 FSF 的 ftp 伺服器進行安裝。如果您使用的是 Mac,請從 emacsformacosx.com 安裝

答案2

調試啟動緩慢問題的一般方法是使用 emacs 的中斷訊號(https://emacs.stackexchange.com/questions/506/debugging-a-frozen-emacs

  1. 跑步emacs --debug-init
  2. 尋找進程的 pidps -ef | grep emacs
  3. 向行程發送中斷訊號kill -SIGUSR2 $PID
  4. 這會導致 emacs 顯示回溯
  5. 在網路上搜尋此回溯中任何明顯的內容
  6. 否則,開始嘗試手動運行其中一些函數,看看它們為什麼慢。

您可能也對 emacs stackexchange 感興趣。 (我不確定我自己對 stackexchange 碎片的看法......)

答案3

一種解決方法是暫停 Emacs,C-z然後使用 shell 命令fg恢復,而不是退出。

相關內容