emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r107572: * simple.el (goto-line): Doc


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107572: * simple.el (goto-line): Doc fix.
Date: Mon, 12 Mar 2012 00:57:04 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107572
fixes bug(s): http://debbugs.gnu.org/9938
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Mon 2012-03-12 00:57:04 +0800
message:
  * simple.el (goto-line): Doc fix.
modified:
  lisp/ChangeLog
  lisp/simple.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-03-11 16:10:07 +0000
+++ b/lisp/ChangeLog    2012-03-11 16:57:04 +0000
@@ -1,5 +1,7 @@
 2012-03-11  Chong Yidong  <address@hidden>
 
+       * simple.el (goto-line): Doc fix (Bug#9938).
+
        * subr.el (save-window-excursion): Doc fix (Bug#9979).
 
        * dabbrev.el (dabbrev--find-expansion): Update progress reporter

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2012-03-05 15:53:34 +0000
+++ b/lisp/simple.el    2012-03-11 16:57:04 +0000
@@ -893,16 +893,23 @@
 ;; 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.
-
-If there's a number in the buffer at point, it is the default for LINE.
+  "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.
+
+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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]