Closed jdtsmith closed 1 year ago
Thanks for this. I'd like to add it, but I've got warnings in package-lint. In particular end-of-buffer is supposed to be called only interactively.
Why wouldn't the linter complain about scroll-up along those lines? Does wrapping in call-interactively
quiet it? Look who overrides their own warning. We could do that ;).
(defun end-of-buffer-other-window (arg)
"Move point to the end of the buffer in the other window.
Leave mark at previous position.
With arg N, put point N/10 of the way from the true end."
(interactive "P")
;; See beginning-of-buffer-other-window for comments.
(with-selected-window (other-window-for-scrolling)
(with-no-warnings
(end-of-buffer arg))
(recenter '(t))))
The reason is that the command is marked as interactive-only, so we should not use it. And no, we should also not add with-no-warnings.
EDIT: Considering that end-of-buffer-other-window
has the evil with-no-warnings
lets just also do this here.
To go along with scroll-up/down. These can be conveniently also be used with numeric prefixes, so
M-3 M-end
goes 30% from the end, etc.