emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp simple.el


From: Stefan Monnier
Subject: [Emacs-diffs] emacs/lisp simple.el
Date: Mon, 10 Aug 2009 16:38:17 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/08/10 16:38:17

Modified files:
        lisp           : simple.el 

Log message:
        (goto-line): Fix up docstring.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/simple.el?cvsroot=emacs&r1=1.1001&r2=1.1002

Patches:
Index: simple.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/simple.el,v
retrieving revision 1.1001
retrieving revision 1.1002
diff -u -b -r1.1001 -r1.1002
--- simple.el   31 Jul 2009 02:14:46 -0000      1.1001
+++ simple.el   10 Aug 2009 16:38:16 -0000      1.1002
@@ -847,12 +847,15 @@
   "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.  When called from Lisp code, the optional argument BUFFER
-specifies a buffer to switch to.
+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."
+If there's a number in the buffer at point, it is the default for LINE.
+
+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))
+If at all possible, an even better solution is to use char counts
+rather than line counts."
   (interactive
    (if (and current-prefix-arg (not (consp current-prefix-arg)))
        (list (prefix-numeric-value current-prefix-arg))
@@ -892,7 +895,7 @@
   ;; Move to the specified line number in that buffer.
   (save-restriction
     (widen)
-    (goto-char 1)
+    (goto-char (point-min))
     (if (eq selective-display t)
        (re-search-forward "[\n\C-m]" nil 'end (1- line))
       (forward-line (1- line)))))




reply via email to

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