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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With