minad / corfu

:desert_island: corfu.el - COmpletion in Region FUnction
GNU General Public License v3.0
1.15k stars 43 forks source link

Remap beg/end-of-other-window for popupinfo #270

Closed jdtsmith closed 1 year ago

jdtsmith commented 1 year ago

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.

minad commented 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.

jdtsmith commented 1 year ago

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))))
minad commented 1 year ago

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.