summaryrefslogtreecommitdiff
path: root/doc/emacs
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2020-09-23 22:39:32 +0300
committerJuri Linkov <juri@linkov.net>2020-09-23 22:39:32 +0300
commitdc86c4cc0ba230c632b10cefb22b9fec1cd1d046 (patch)
tree92a8db4b07c29afbd77848760685008a3f82ff1e /doc/emacs
parentad285e0eb8ae18f41a4d94b1a57a5ee118f6814f (diff)
downloademacs-dc86c4cc0ba230c632b10cefb22b9fec1cd1d046.tar.gz
emacs-dc86c4cc0ba230c632b10cefb22b9fec1cd1d046.tar.bz2
emacs-dc86c4cc0ba230c632b10cefb22b9fec1cd1d046.zip
New command goto-line-relative (bug#5042, bug#9917)
* lisp/simple.el (goto-line-read-args): New function with code from goto-line. (goto-line): New arg RELATIVE. Also use 'widen-automatically' to leave all lines accessible in the narrowed buffer. (goto-line-relative): New command. * lisp/info.el (Info-mode-map): Remap 'goto-line' to 'goto-line-relative'. * doc/emacs/basic.texi (Moving Point): * doc/emacs/display.texi (Optional Mode Line): Mention goto-line-relative.
Diffstat (limited to 'doc/emacs')
-rw-r--r--doc/emacs/basic.texi5
-rw-r--r--doc/emacs/display.texi7
2 files changed, 8 insertions, 4 deletions
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi
index 444b2469cf1..cde7b475d95 100644
--- a/doc/emacs/basic.texi
+++ b/doc/emacs/basic.texi
@@ -311,13 +311,16 @@ Position 1 is the beginning of the buffer.
@kindex M-g M-g
@kindex M-g g
@findex goto-line
+@findex goto-line-relative
Read a number @var{n} and move point to the beginning of line number
@var{n} (@code{goto-line}). Line 1 is the beginning of the buffer. If
point is on or just after a number in the buffer, that is the default
for @var{n}. Just type @key{RET} in the minibuffer to use it. You can
also specify @var{n} by giving @kbd{M-g M-g} a numeric prefix argument.
@xref{Select Buffer}, for the behavior of @kbd{M-g M-g} when you give it
-a plain prefix argument.
+a plain prefix argument. Alternatively, you can use the command
+@code{goto-line-relative} to move point to the line relative to the
+accessible portion of the narrowed buffer.
@item M-g @key{TAB}
@kindex M-g TAB
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index e7b8745a044..6f1bc802b85 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -1452,9 +1452,10 @@ the displayed column number to count from one, you may set
@cindex narrowing, and line number display
If you have narrowed the buffer (@pxref{Narrowing}), the displayed
line number is relative to the accessible portion of the buffer.
-Thus, it isn't suitable as an argument to @code{goto-line}. (Use
-@code{what-line} command to see the line number relative to the whole
-file.)
+Thus, it isn't suitable as an argument to @code{goto-line}. (The
+command @code{what-line} shows the line number relative to the whole
+file.) You can use @code{goto-line-relative} command to move point to
+the line relative to the accessible portion of the narrowed buffer.
@vindex line-number-display-limit
If the buffer is very large (larger than the value of