Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the compile buffer place the point at its end?

Tags:

emacs

build

elisp

When I compile (using Make, g++), the compile-buffer opens in a new window, and starts filling up with lines of compiler output. What I don't like is that when the number of lines exceeds the window height, the window doesn't scroll to show the most recent messages at the bottom. Instead it just stays at the top of the buffer, adding the newest messages below the bottom of the window, out of view.

I work around this by switching to the compile window and moving the point to the end of the buffer using M-shift-'>'. Once the point is at the end, it stays there even when additional lines are added, so the bottom-most line stays visible in the window.

How can I automate this behavior, so that compiling not only opens up the compile buffer in a new window, but also moves (that window's) point to the end?

like image 666
SuperElectric Avatar asked Oct 12 '11 16:10

SuperElectric


1 Answers

Look into the compilation-scroll-output variable. Instead of just scrolling to the end (setting it to t) I propose 'first-error that scrolls to the first error.

like image 182
Michael Markert Avatar answered Sep 18 '22 18:09

Michael Markert