1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

(progn (scroll-up 1) (goto-char 0)) is different from (scroll-up 1) then (goto-char 0)

Discussion in 'Technology' started by jcarpenter2, Aug 2, 2020 at 12:38 PM.

  1. jcarpenter2

    jcarpenter2 Guest

    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))?

    Login To add answer/comment
     

Share This Page