Subject: Re: bug#6861: 24.0.50; Scroll lock not bound

From: Stefan Kangas <[email-masked]>
Date: Sat, 28 Sep 2019 15:11:59 +0200

Eli Zaretskii <[email-masked]> writes:

> > OK.  How about the attached patch?
>
> It's fine, but please say "MS-Windows" to be more precise.

Thanks; fixed in attached patch.  I'll push it in a couple of days if
there are no further comments.

Best regards,
Stefan Kangas
From 4e45ae74bffd9c4f8ff8427eb4c41cfee167b3f1 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Tue, 20 Aug 2019 19:04:16 +0200
Subject: [PATCH] Bind Scroll_Lock to scroll-lock-mode globally

* lisp/bindings.el (global-map): Bind Scroll_Lock to
scroll-lock-mode.  (Bug#6861)
* lisp/scroll-lock.el (scroll-lock-mode): Note that the binding will
not work if 'w32-scroll-lock-modifier' is non-nil.
* etc/NEWS: Announce it.
---
 etc/NEWS            | 5 +++++
 lisp/bindings.el    | 1 +
 lisp/scroll-lock.el | 5 ++++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index 56e5fd2f83..60b583200a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -419,6 +419,11 @@ RGB triplets with a single hexadecimal digit per component.
 ---
 ** The toolbar now shows the equivalent key binding in its tooltips.
 
+---
+** 'scroll-lock-mode' is now bound to the 'Scroll_Lock' key globally.
+Note that this key binding will not work on MS-Windows systems if
+'w32-scroll-lock-modifier' is non-nil.
+
 
 * Editing Changes in Emacs 27.1
 
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 0be1458798..16da2bdf9a 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -1054,6 +1054,7 @@ global-map
 ;(define-key global-map [delete] 'backward-delete-char)
 
 ;; natural bindings for terminal keycaps --- defined in X keysym order
+(define-key global-map [Scroll_Lock]    'scroll-lock-mode)
 (define-key global-map [C-S-backspace]  'kill-whole-line)
 (define-key global-map [home]		'move-beginning-of-line)
 (define-key global-map [C-home]		'beginning-of-buffer)
diff --git a/lisp/scroll-lock.el b/lisp/scroll-lock.el
index 3a74c11b7a..36e2264fe4 100644
--- a/lisp/scroll-lock.el
+++ b/lisp/scroll-lock.el
@@ -54,7 +54,10 @@ scroll-lock-mode
 When enabled, keys that normally move point by line or paragraph
 will scroll the buffer by the respective amount of lines instead
 and point will be kept vertically fixed relative to window
-boundaries during scrolling."
+boundaries during scrolling.
+
+Note that the default key binding to Scroll_Lock will not work on
+MS-Windows systems if `w32-scroll-lock-modifier' is non-nil."
   :lighter " ScrLck"
   :keymap scroll-lock-mode-map
   (if scroll-lock-mode
-- 
2.20.1