tags:

views:

313

answers:

3

By default, emacs 22.1.1 only shows the top of the compilation buffer when you first issue the compile command. I would like it to scroll to the bottom automatically when I use the compile command in order to save keystrokes. This way I can easily get a status of the current compilation by just looking at the compile buffer and seeing which files are currently being compiled instead of having to switch windows and scroll to the bottom of the buffer. Any ideas?

+8  A: 

From Info > emacs > Compilation:

If you set the variable compilation-scroll-output to a non-nil value, then the compilation buffer always scrolls to follow output as it comes in.

Blair Conrad
+3  A: 
(setq compilation-scroll-output t)

or

M-x set-variable compilation-scroll-output t RET

Also, if you get used to using next-error and previous-error before your compilation finishes, you will start to see why the default behavior is desirable.

jfm3
A: 

I think the best option is to stop on the first error

(setq compilation-scroll-output 'first-error)

With this configuration, Emacs scrolls compilation mode until the first error happens. This allows you to use next-error and previous-error before compilation finishes.

If there aren't any errors, it scrolls until the end and you can thus easily see that compilation was succesful.

tequilatango