From c09abf6b4f634146ca9b69bb519daa5f71410f71 Mon Sep 17 00:00:00 2001 From: Zedhugh Chen Date: Thu, 26 Mar 2026 23:16:29 +0800 Subject: [PATCH] fix: correct goto-line-relative behavior in narrowed buffers the built-in function `goto-line-relative` passes an improper argument list to `interactive`, which expects a proper list. --- lisp/init-built-in.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lisp/init-built-in.el b/lisp/init-built-in.el index 268fccb..85609d8 100644 --- a/lisp/init-built-in.el +++ b/lisp/init-built-in.el @@ -130,4 +130,15 @@ (add-to-list 'compilation-environment "NO_COLOR=1")) +;;; fix `goto-line-relative' +(defun fix/goto-line-relative (line &optional buffer interactive) + "Go to LINE, counting from line at (point-min). +The line number is relative to the accessible portion of the narrowed +buffer. The arguments BUFFER and INTERACTIVE are the same as in the +function `goto-line'." + (interactive (append (goto-line-read-args t) '(t))) + (goto-line line buffer t interactive)) +(advice-add 'goto-line-relative :override #'fix/goto-line-relative) + + (provide 'init-built-in)