In any buffer, try to eval-expression
the expression (scroll-up 1)
and then eval (goto-char 0)
. The window scrolls up, then point is moved to the beginning of the buffer. Now, try eval-ing (progn (scroll-up 1) (goto-char 0))
. Here, point is not moved to the beginning of the buffer; the window scrolls up 1 line and point is moved to the middle of the screen.
Why is running (scroll-up 1)
and then running (goto-char 0)
any different from running (progn (scroll-up 1) (goto-char 0))
?