6

How can I prevent the *tex-shell* buffer from opening when I compile Latex from Emacs? It splits the window in half, and I always just use C-x 1 to get rid of it immediately.

The solution is possibly related to

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

which makes the new buffer take up the whole frame instead of just half (not what I want).

I tried the following, but it has no effect for 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)
zoo
  • 1,901
  • 1
  • 17
  • 25
  • I don't think so. The mode is "LaTeX". Actually, I only have this problem on OS X. On Ubuntu, the mode is "LaTeX/P", and tex-shell doesn't open. – zoo Mar 04 '12 at 23:49
  • What major mode does `C-h m` say you are in? – N.N. Mar 05 '12 at 15:30
  • "LaTeX mode: Major mode for editing files of input for LaTeX." – zoo Mar 06 '12 at 04:25

2 Answers2

1

Well, you really should be using AUCTeX since it's much better. Nevertheless if you type C-hk and then a key sequence Emacs will tell you what would be run. In this case, for C-cC-f, it's tex-file so you will have to advise tex-file, or maybe (digging down into the source a little bit) tex-start-shell.

Ivan Andrus
  • 5,221
  • 24
  • 31
0

I use the following defun:

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

I bind it to C-c C-f to replace tex-file.

gempesaw
  • 329
  • 3
  • 12
  • can you walk through how to bind it to `C-c C-f`? – abcd Jun 07 '19 at 16:55
  • One way would be to overwrite the binding in the tex's major mode map (warning, untested code): `(eval-after-load 'tex-mode '(define-key tex-mode-map (kbd "C-c C-f") #'my-tex-file-replacement))` more info: https://emacs.stackexchange.com/questions/352/how-to-override-major-mode-bindings, https://emacs.stackexchange.com/a/41617/672 – gempesaw Jun 20 '19 at 15:43