1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Fix shift-translation support of 'scroll-lock-mode' commands

* lisp/scroll-lock.el (scroll-lock-next-line-always-scroll)
(scroll-lock-next-line, scroll-lock-previous-line)
(scroll-lock-forward-paragraph, scroll-lock-backward-paragraph):
Make them support shift-translation, like the commands remapped to
them do.  (Bug#79022)
This commit is contained in:
Eli Zaretskii 2025-07-15 16:23:03 +03:00
parent c82a62fa36
commit 1ea3d7b1f7

View file

@ -84,7 +84,7 @@ MS-Windows systems if `w32-scroll-lock-modifier' is non-nil."
(defun scroll-lock-next-line-always-scroll (&optional arg) (defun scroll-lock-next-line-always-scroll (&optional arg)
"Scroll up ARG lines keeping point fixed." "Scroll up ARG lines keeping point fixed."
(interactive "p") (interactive "^p")
(or arg (setq arg 1)) (or arg (setq arg 1))
(scroll-lock-update-goal-column) (scroll-lock-update-goal-column)
(condition-case nil (condition-case nil
@ -94,7 +94,7 @@ MS-Windows systems if `w32-scroll-lock-modifier' is non-nil."
(defun scroll-lock-next-line (&optional arg) (defun scroll-lock-next-line (&optional arg)
"Scroll up ARG lines keeping point fixed." "Scroll up ARG lines keeping point fixed."
(interactive "p") (interactive "^p")
(or arg (setq arg 1)) (or arg (setq arg 1))
(scroll-lock-update-goal-column) (scroll-lock-update-goal-column)
(if (pos-visible-in-window-p (point-max)) (if (pos-visible-in-window-p (point-max))
@ -104,7 +104,7 @@ MS-Windows systems if `w32-scroll-lock-modifier' is non-nil."
(defun scroll-lock-previous-line (&optional arg) (defun scroll-lock-previous-line (&optional arg)
"Scroll up ARG lines keeping point fixed." "Scroll up ARG lines keeping point fixed."
(interactive "p") (interactive "^p")
(or arg (setq arg 1)) (or arg (setq arg 1))
(scroll-lock-update-goal-column) (scroll-lock-update-goal-column)
(condition-case nil (condition-case nil
@ -114,7 +114,7 @@ MS-Windows systems if `w32-scroll-lock-modifier' is non-nil."
(defun scroll-lock-forward-paragraph (&optional arg) (defun scroll-lock-forward-paragraph (&optional arg)
"Scroll down ARG paragraphs keeping point fixed." "Scroll down ARG paragraphs keeping point fixed."
(interactive "p") (interactive "^p")
(or arg (setq arg 1)) (or arg (setq arg 1))
(scroll-lock-update-goal-column) (scroll-lock-update-goal-column)
(scroll-up (count-screen-lines (point) (save-excursion (scroll-up (count-screen-lines (point) (save-excursion
@ -124,7 +124,7 @@ MS-Windows systems if `w32-scroll-lock-modifier' is non-nil."
(defun scroll-lock-backward-paragraph (&optional arg) (defun scroll-lock-backward-paragraph (&optional arg)
"Scroll up ARG paragraphs keeping point fixed." "Scroll up ARG paragraphs keeping point fixed."
(interactive "p") (interactive "^p")
(or arg (setq arg 1)) (or arg (setq arg 1))
(scroll-lock-update-goal-column) (scroll-lock-update-goal-column)
(let ((goal (save-excursion (backward-paragraph arg) (point)))) (let ((goal (save-excursion (backward-paragraph arg) (point))))