从Emacs编译Latex时停止打开tex-shell

时间:2012-03-03 23:29:36

标签: emacs latex elisp dot-emacs

当我从Emacs编译Latex时,如何防止打开* tex-shell *缓冲区?它将窗口分成两半,我总是只使用C-x 1来立即删除它。

解决方案可能与

有关
(setq special-display-buffer-names ("*tex-shell*"))

这使得新缓冲区占用整个帧而不是一半(不是我想要的)。

我尝试了以下操作,但它对Latex没有影响:

(defadvice compilation-start
    (around inhidbit-display (command &optional mode name-function highlight-regexp))
    (flet (display-buffer) (fset 'display-buffer 'ignore) ad-do-it))
(ad-activate 'compilation-start)
(ad-deactivate 'compilation-start)

2 个答案:

答案 0 :(得分:1)

嗯,你真的应该使用AUCTeX因为它好多了。然而,如果你键入 C-h C-k 然后一个键序列Emacs会告诉你将运行什么。在这种情况下,对于 Cc Cf ,它是tex-file所以你必须建议tex-file,或者可能(稍微深入了解一下来源)位)tex-start-shell

答案 1 :(得分:0)

我使用以下defun:

(defun tex-without-changing-windows ()
  (interactive)
  (save-buffer)
  (save-window-excursion (tex-file)))

我将其绑定到C-c C-f以替换tex-file