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.
This commit is contained in:
zedhugh committed 2026-03-26 23:16:29 +08:00
1 parent 363715576c
commit c09abf6b4f
1 file changed
+11
+11
View File
@@ -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)