* simple.el (goto-line): Doc fix.

Fixes: debbugs:9938
This commit is contained in:
Chong Yidong 2012-03-12 00:57:04 +08:00
parent 66c5eebd41
commit 397a688f21
2 changed files with 15 additions and 6 deletions

View file

@ -1,5 +1,7 @@
2012-03-11 Chong Yidong <cyd@gnu.org> 2012-03-11 Chong Yidong <cyd@gnu.org>
* simple.el (goto-line): Doc fix (Bug#9938).
* subr.el (save-window-excursion): Doc fix (Bug#9979). * subr.el (save-window-excursion): Doc fix (Bug#9979).
* dabbrev.el (dabbrev--find-expansion): Update progress reporter * dabbrev.el (dabbrev--find-expansion): Update progress reporter

View file

@ -893,16 +893,23 @@ that uses or sets the mark."
;; Counting lines, one way or another. ;; Counting lines, one way or another.
(defun goto-line (line &optional buffer) (defun goto-line (line &optional buffer)
"Goto LINE, counting from line 1 at beginning of buffer. "Go to LINE, counting from line 1 at beginning of buffer.
Normally, move point in the current buffer, and leave mark at the If called interactively, a numeric prefix argument specifies
previous position. With just \\[universal-argument] as argument, LINE; without a numeric prefix argument, read LINE from the
move point in the most recently selected other buffer, and switch to it. minibuffer.
If there's a number in the buffer at point, it is the default for LINE. If optional argument BUFFER is non-nil, switch to that buffer and
move to line LINE there. If called interactively with \\[universal-argument]
as argument, BUFFER is the most recently selected other buffer.
Prior to moving point, this function sets the mark (without
activating it), unless Transient Mark mode is enabled and the
mark is already active.
This function is usually the wrong thing to use in a Lisp program. This function is usually the wrong thing to use in a Lisp program.
What you probably want instead is something like: What you probably want instead is something like:
(goto-char (point-min)) (forward-line (1- N)) (goto-char (point-min))
(forward-line (1- N))
If at all possible, an even better solution is to use char counts If at all possible, an even better solution is to use char counts
rather than line counts." rather than line counts."
(interactive (interactive