From: Juri Linkov Date: Thu, 24 Sep 2020 18:52:22 +0000 (+0300) Subject: * lisp/simple.el (goto-line-read-args): More relevant default line number. X-Git-Tag: emacs-28.0.90~5907 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4bc4d19bd16735f9ee79b2e736eeab59d57070d7;p=emacs.git * lisp/simple.el (goto-line-read-args): More relevant default line number. --- diff --git a/lisp/simple.el b/lisp/simple.el index 7cb71530b36..6bc41961eba 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1259,7 +1259,11 @@ that uses or sets the mark." ;; In a narrowed buffer. (if relative " relative" " absolute")) buffer-prompt) - (list default (line-number-at-pos)) + (list default (if (or relative (= (point-min) 1)) + (line-number-at-pos) + (save-restriction + (widen) + (line-number-at-pos)))) 'goto-line-history) buffer))))