diff options
author | Chong Yidong <cyd@gnu.org> | 2012-03-12 00:57:04 +0800 |
---|---|---|
committer | Chong Yidong <cyd@gnu.org> | 2012-03-12 00:57:04 +0800 |
commit | 397a688f21317fbbd59a820fc20cccbad8cf89fd (patch) | |
tree | 431184bd915d996476589152ab58e92f9f42f6e6 /lisp/simple.el | |
parent | 66c5eebd416975af2bb1b2e0557dac967cc51f16 (diff) | |
download | emacs-397a688f21317fbbd59a820fc20cccbad8cf89fd.tar.gz |
* simple.el (goto-line): Doc fix.
Fixes: debbugs:9938
Diffstat (limited to 'lisp/simple.el')
-rw-r--r-- | lisp/simple.el | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 45daf99f614..f42ea3e7a50 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -893,16 +893,23 @@ that uses or sets the mark." ;; Counting lines, one way or another. (defun goto-line (line &optional buffer) - "Goto LINE, counting from line 1 at beginning of buffer. -Normally, move point in the current buffer, and leave mark at the -previous position. With just \\[universal-argument] as argument, -move point in the most recently selected other buffer, and switch to it. + "Go to LINE, counting from line 1 at beginning of buffer. +If called interactively, a numeric prefix argument specifies +LINE; without a numeric prefix argument, read LINE from the +minibuffer. + +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. -If there's a number in the buffer at point, it is the default for LINE. +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. 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 rather than line counts." (interactive |