]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/simple.el (goto-line-read-args): More relevant default line number.
authorJuri Linkov <juri@linkov.net>
Thu, 24 Sep 2020 18:52:22 +0000 (21:52 +0300)
committerJuri Linkov <juri@linkov.net>
Thu, 24 Sep 2020 18:52:22 +0000 (21:52 +0300)
lisp/simple.el

index 7cb71530b36a4711696e6a79ff2933bfdd0b550b..6bc41961eba543be9b10f4059bac9f96bc6294b5 100644 (file)
@@ -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))))