Subject: `scroll-margin' sometimes doesn't work
From: Shynur Xie <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Mon, 1 May 2023 10:45:11 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

`scroll-margin' sometimes doesn't work

1. emacs -Q
2. In buffer *scratch*, C-x C-e:
    (progn
      (custom-set-variables
       '(custom-enabled-themes '(modus-vivendi))
       '(global-tab-line-mode t)
       '(scroll-margin 1)
       '(scroll-conservatively 101))
      (info-emacs-manual)
      (end-of-buffer)
      (goto-line 500))
3. With the cursor now at the 2nd line from the top of the window,
   press <up>-arrow-key several times and pay attention to resulting
   cursor position -- `scroll-margin' is 1 but Emacs still sometimes
   allows the cursor to stay at the 1st line of the window.

I uploaded a GIF at <https://emacs.stackexchange.com/questions/76649>
to show this behavior.

--
shynur