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

前端 未结 6 712
借酒劲吻你
借酒劲吻你 2021-01-07 22:42

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

Can I do that?

6条回答
  •  时光取名叫无心
    2021-01-07 23:10

    This code seems a bit overkill, but a the simple (goto-char (point-max)) wasn't working for me:

    (defadvice message (after message-tail activate)
      "goto point max after a message"
      (with-current-buffer "*Messages*"
        (goto-char (point-max))
        (let ((windows (get-buffer-window-list (current-buffer) nil t)))
          (while windows
            (set-window-point (car windows) (point-max))
            (setq windows (cdr windows))))))
    

提交回复
热议问题