clearf
clearf

Reputation: 586

How do I encourage emacs to follow the compilation buffer

Occasionally when I'm compiling, I have to scroll up my compilation buffer to see the details of an error. At this point, emacs stops "following" my compilation buffer, i.e., scrolling to automatically display new output.

I'm using Aqumacs on OS X. Any idea how I can "reattach" or re encourage the compilation buffer to follow again?

Regards, Chris

Upvotes: 41

Views: 8982

Answers (3)

tsohr
tsohr

Reputation: 909

Put in your ~/.emacs file

  ;; Compilation output
  (setq compilation-scroll-output t)

or even

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

to make it scroll to the first error.

Upvotes: 90

darioo
darioo

Reputation: 47183

Try using M-x auto-revert-tail-mode or M-x auto-revert-mode. Taken from official documentation:

One use of Auto-Revert mode is to “tail” a file such as a system log, so that changes made to that file by other programs are continuously displayed. To do this, just move the point to the end of the buffer, and it will stay there as the file contents change. However, if you are sure that the file will only change by growing at the end, use Auto-Revert Tail mode instead (auto-revert-tail-mode). It is more efficient for this. Auto-Revert Tail mode works also for remote files.

So, as Chmouel already noted, just moving point to end of buffer will also work.

Upvotes: 5

Chmouel Boudjnah
Chmouel Boudjnah

Reputation: 2559

I am not sure about aquamacs but for me (Emacs 23/Debian) I just go in the compilation window and place my cursor at the end of the window which will attach and follow (you can go to another window and it will still follow).

Upvotes: 4

Related Questions