Skip to content

Commit 16bcbfc

Browse files
committed
Don't force recentering, and avoid use of with-no-warnings
- Recentering means the window moves even if the command is cancelled. In reality, Emacs behaves reasonably even when without calling recenter, and its behaviour is configurable, so we shouldn't hard-code recentering here. - Use the recommended non-interactive alternative to goto-line, so that with-no-warnings is unnecessary
1 parent 3c8441b commit 16bcbfc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

goto-line-preview.el

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@
6767
LINE-NUM : Target line number to navigate to."
6868
(save-selected-window
6969
(switch-to-buffer goto-line-preview-prev-buffer)
70-
(with-no-warnings
71-
(goto-line line-num))
72-
(call-interactively #'recenter)))
70+
(goto-char (point-min))
71+
(forward-line (1- line-num))))
7372

7473

7574
;;;###autoload

0 commit comments

Comments
 (0)