Context: I have a window that shows the output of a shell command. As new lines are added, I'd like the window to always show the most recent lines. Example:
(let ((temp-window (or (get-buffer-window "*test*")
(split-window-below -10))))
(start-process-shell-command
"test-process"
"*test*"
"sleep 1; ps -ax")
(set-window-buffer temp-window "*test*"))
For reasons that I don't understand, the window scrolls the first time this code is executed but not the second time (when the buffer already exists).
I'm on Emacs 26.0.60 on Ubuntu 16.04.