'Something Enables scroll-lock-mode in Emacs

I have Emacs running in WSL2

GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars) of 2021-07-20

About couple of weeks ago open buffers started getting scroll-lock-mode enabled. I have it set to nil by default. Moreover, if I disable scroll-lock-mode after some time it gets enabled. I don't have anything anywhere in the configuration related to scrolling. I have instrumented scroll-lock-mode function, but when it jumps in it, seems to be called from random spots

  (let ((last-message (current-message))) (setq scroll-lock-mode (cond ((eq arg 'toggle) (not scroll-lock-mode)) ((and (numberp arg) (< arg 1)) nil) (t t))) (when (boundp 'local-minor-modes) (setq local-minor-modes (delq 'scroll-lock-mode local-minor-modes)) (when scroll-lock-mode (push 'scroll-lock-mode local-minor-modes))) (if scroll-lock-mode (progn (setq scroll-lock-preserve-screen-pos-save scroll-preserve-screen-position) (setq-local scroll-preserve-screen-position 'always)) (setq scroll-preserve-screen-position scroll-lock-preserve-screen-pos-save)) (run-hooks 'scroll-lock-mode-hook (if scroll-lock-mode 'scroll-lock-mode-on-hook 'scroll-lock-mode-off-hook)) (if (called-interactively-p 'any) (progn nil (unless (and (current-message) (not (equal last-message (current-message)))) (let ((local " in current buffer")) (message "Scroll-Lock mode %sabled%s" (if scroll-lock-mode "en" "dis") local))))))
  scroll-lock-mode(toggle)
  funcall-interactively(scroll-lock-mode toggle)
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> scroll-lock-mode nil nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (scroll-lock-mode nil nil))
  call-interactively(scroll-lock-mode nil nil)
  command-execute(scroll-lock-mode)

Here's the sample of the Messages buffer

Scroll-Lock mode enabled in current buffer
Scroll-Lock mode disabled in current buffer
GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars) of 2021-07-20
Mark set
Scroll-Lock mode enabled in current buffer

How to I make it disabled for good ? I used (setq-default scroll-lock-mode nil) but it is still being enabled by something.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source