Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In emacs, can I set up the *Messages* buffer so that it tails?

Tags:

emacs

Basically I want the *Messages* buffer to always scroll to the bottom when a new message arrives.

Can I do that?

I found auto-revert-tail-mode but that works for buffers that are visiting files. When I tried it in the Messages buffer, it popped an error:
auto-revert-tail-mode: This buffer is not visiting a file

like image 373
Cheeso Avatar asked Jan 13 '11 15:01

Cheeso


1 Answers

For multiple frames you probably want:

(defadvice message (after message-tail activate)
  "goto point max after a message"
  (with-current-buffer "*Messages*"
    (goto-char (point-max))
    (walk-windows (lambda (window)
                    (if (string-equal (buffer-name (window-buffer window)) "*Messages*")
                        (set-window-point window (point-max))))
                  nil
                  t)))
like image 195
Peter Avatar answered Oct 18 '22 16:10

Peter