changeset 104543:da8b3e61b182

Use forward-line rather than goto-line.
author Glenn Morris <rgm@gnu.org>
date Sat, 22 Aug 2009 19:29:18 +0000
parents 5986db97372e
children 5a7504ff8b85
files lisp/ChangeLog lisp/bs.el lisp/calc/calc.el lisp/cus-edit.el lisp/ibuffer.el lisp/play/gamegrid.el lisp/progmodes/ada-mode.el lisp/progmodes/ada-xref.el lisp/progmodes/ebrowse.el lisp/progmodes/gud.el lisp/progmodes/idlw-shell.el lisp/progmodes/vhdl-mode.el lisp/server.el lisp/startup.el lisp/strokes.el lisp/term.el lisp/textmodes/picture.el lisp/textmodes/reftex-index.el lisp/textmodes/reftex-sel.el lisp/textmodes/reftex-toc.el lisp/textmodes/rst.el lisp/textmodes/tex-mode.el lisp/textmodes/two-column.el lisp/view.el
diffstat 24 files changed, 207 insertions(+), 112 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/ChangeLog	Sat Aug 22 19:29:18 2009 +0000
@@ -1,3 +1,50 @@
+2009-08-22  Glenn Morris  <rgm@gnu.org>
+
+	* bs.el (bs--redisplay):
+	* cus-edit.el (custom-redraw):
+	* ibuffer.el (ibuffer-bury-buffer):
+	* server.el (server-goto-line-column):
+	* startup.el (command-line-1):
+	* strokes.el (strokes-xpm-for-stroke):
+	* term.el (term-display-buffer-line):
+	* view.el (View-goto-line):
+	* calc/calc.el (calc-do, calc-trail-buffer):
+	* play/gamegrid.el (gamegrid-add-score-insecure):
+	* progmodes/ada-mode.el (ada-compile-goto-error):
+	* progmodes/ada-xref.el (ada-xref-find-in-modified-ali):
+	(ebrowse-select-1st-to-9nth):
+	* progmodes/ebrowse.el (ebrowse-toggle-file-name-display)
+	* progmodes/gud.el (gud-display-line):
+	(idlwave-shell-display-line):
+	* progmodes/idlw-shell.el (idlwave-shell-goto-frame)
+	* progmodes/make-mode.el (makefile-browser-toggle):
+	(vhdl-speedbar-port-copy, vhdl-compose-components-package):
+	* progmodes/vhdl-mode.el (vhdl-speedbar-find-file)
+	* textmodes/picture.el (picture-draw-rectangle):
+	* textmodes/reftex-index.el (reftex-index-goto-letter):
+	(reftex-select-jump-to-previous):
+	* textmodes/reftex-sel.el (reftex-find-start-point)
+	* textmodes/reftex-toc.el (reftex-toc, reftex-toc-restore-region):
+	(rst-straighten-deco-spacing, rst-section-tree, rst-toc):
+	* textmodes/rst.el (rst-promote-region, rst-straighten-decorations)
+	* textmodes/tex-mode.el (tex-compilation-parse-errors):
+	* textmodes/two-column.el (2C-associated-buffer):
+	Use forward-line rather than goto-line.
+
+	* emulation/vi.el (vi-goto-line): Don't warn about non-interactive
+	goto-line.
+
+	* international/ucs-normalize.el (nfd)
+	(decomposition-translation-alist, decomposition-char-recursively)
+	(alist-list-to-vector, quick-check-list, quick-check-list-to-regexp):
+	Declare.
+
+	* progmodes/make-mode.el (makefile-browser-insert-selection): Use
+	goto-char rather than goto-line.
+
+	* progmodes/prolog.el (compilation-error-regexp-alist)
+	(compilation-forget-errors): Declare.
+
 2009-08-22  Juri Linkov  <juri@jurta.org>
 
 	* progmodes/grep.el (lgrep, rgrep): At the beginning
--- a/lisp/bs.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/bs.el	Sat Aug 22 19:29:18 2009 +0000
@@ -1,7 +1,7 @@
 ;;; bs.el --- menu for selecting and displaying buffers
 
-;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+;;   2007, 2008, 2009  Free Software Foundation, Inc.
 ;; Author: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
 ;; Maintainer: Olaf Sylvester <Olaf.Sylvester@netsurf.de>
 ;; Keywords: convenience
@@ -575,10 +575,11 @@
   "Redisplay whole Buffer Selection Menu.
 If KEEP-LINE-P is non-nil the point will stay on current line.
 SORT-DESCRIPTION is an element of `bs-sort-functions'."
-  (let ((line (1+ (count-lines 1 (point)))))
+  (let ((line (count-lines 1 (point))))
     (bs-show-in-buffer (bs-buffer-list nil sort-description))
     (when keep-line-p
-      (goto-line line))
+      (goto-char (point-min))
+      (forward-line line))
     (beginning-of-line)))
 
 (defun bs--goto-current-buffer ()
--- a/lisp/calc/calc.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/calc/calc.el	Sat Aug 22 19:29:18 2009 +0000
@@ -1,7 +1,7 @@
 ;;; calc.el --- the GNU Emacs calculator
 
-;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004, 2005,
+;;   2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
@@ -1615,11 +1615,13 @@
       (and (memq 'position-point calc-command-flags)
 	   (if (eq major-mode 'calc-mode)
 	       (progn
-		 (goto-line calc-final-point-line)
+		 (goto-char (point-min))
+		 (forward-line (1- calc-final-point-line))
 		 (move-to-column calc-final-point-column))
 	     (save-current-buffer
 	       (calc-select-buffer)
-	       (goto-line calc-final-point-line)
+	       (goto-char (point-min))
+	       (forward-line (1- calc-final-point-line))
 	       (move-to-column calc-final-point-column))))
       (unless (memq 'keep-flags calc-command-flags)
 	(save-excursion
@@ -2019,7 +2021,8 @@
 	   (eq (marker-buffer calc-trail-pointer) calc-trail-buffer))
       (save-excursion
 	(set-buffer calc-trail-buffer)
-	(goto-line 2)
+	(goto-char (point-min))
+	(forward-line 1)
 	(setq calc-trail-pointer (point-marker))))
   calc-trail-buffer)
 
--- a/lisp/cus-edit.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/cus-edit.el	Sat Aug 22 19:29:18 2009 +0000
@@ -2192,9 +2192,10 @@
     (when (and (>= pos from) (<= pos to))
       (condition-case nil
 	  (progn
-	    (if (> column 0)
-		(goto-line line)
-	      (goto-line (1+ line)))
+	    (goto-char (point-min))
+	    (forward-line (if (> column 0)
+			      (1- line)
+			    line))
 	    (move-to-column column))
 	(error nil)))))
 
--- a/lisp/ibuffer.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/ibuffer.el	Sat Aug 22 19:29:18 2009 +0000
@@ -1,7 +1,7 @@
 ;;; ibuffer.el --- operate on buffers like dired
 
-;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+;;   2009  Free Software Foundation, Inc.
 
 ;; Author: Colin Walters <walters@verbum.org>
 ;; Maintainer: John Paul Wallington <jpw@gnu.org>
@@ -1093,7 +1093,8 @@
 	(line (+ 1 (count-lines 1 (point)))))
     (bury-buffer buf)
     (ibuffer-update nil t)
-    (goto-line line)))
+    (goto-char (point-min))
+    (forward-line (1- line))))
 
 (defun ibuffer-visit-tags-table ()
   "Visit the tags table in the buffer on this line.  See `visit-tags-table'."
--- a/lisp/play/gamegrid.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/play/gamegrid.el	Sat Aug 22 19:29:18 2009 +0000
@@ -586,7 +586,8 @@
 			  (t ""))))
     (sort-fields 1 (point-min) (point-max))
     (reverse-region (point-min) (point-max))
-    (goto-line (1+ gamegrid-score-file-length))
+    (goto-char (point-min))
+    (forward-line gamegrid-score-file-length)
     (delete-region (point) (point-max))
     (setq buffer-read-only t)
     (save-buffer)))
--- a/lisp/progmodes/ada-mode.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/progmodes/ada-mode.el	Sat Aug 22 19:29:18 2009 +0000
@@ -1,7 +1,7 @@
 ;;; ada-mode.el --- major-mode for editing Ada sources
 
 ;; Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;               2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 
 ;; Author: Rolf Ebert      <ebert@inf.enst.fr>
 ;;      Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de>
@@ -229,6 +229,8 @@
 		 (const ada-no-auto-case))
   :group 'ada)
 
+;; FIXME If this is not something required by the ada language, this
+;; should be removed.
 (defcustom ada-clean-buffer-before-saving t
   "*Non-nil means remove trailing spaces and untabify the buffer before saving."
   :type 'boolean :group 'ada)
@@ -793,8 +795,9 @@
 	(compilation-find-file (point-marker) (match-string 1) "./")
 	(set-buffer file)
 
-	(if (stringp line)
-	    (goto-line (string-to-number line)))
+	(when (stringp line)
+	  (goto-char (point-min))
+	  (forward-line (1- (string-to-number line))))
 
 	(setq source (point-marker)))
 
--- a/lisp/progmodes/ada-xref.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/progmodes/ada-xref.el	Sat Aug 22 19:29:18 2009 +0000
@@ -1,7 +1,7 @@
 ;; ada-xref.el --- for lookup and completion in Ada mode
 
 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-;;               2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
 
 ;; Author: Markus Heritsch <Markus.Heritsch@studbox.uni-stuttgart.de>
 ;;      Rolf Ebert <ebert@inf.enst.fr>
@@ -1901,7 +1901,8 @@
 		   (ada-name-of identlist)))
 	   ;; one => should be the right one
 	   ((= len 1)
-	    (goto-line (caar declist)))
+	    (goto-char (point-min))
+	    (forward-line (1- (caar declist))))
 
 	   ;; more than one => display choice list
 	   (t
@@ -1937,7 +1938,8 @@
 		       (read-from-minibuffer "Enter No. of your choice: "))))
 	      )
 	    (set-buffer ali-buffer)
-	    (goto-line (car (nth (1- choice) declist)))
+	    (goto-char (point-min))
+	    (forward-line (1- (car (nth (1- choice) declist))))
 	    ))))))
 
 
@@ -2166,7 +2168,8 @@
 
     ;; move the cursor to the correct position
     (push-mark)
-    (goto-line line)
+    (goto-char (point-min))
+    (forward-line (1- line))
     (move-to-column column)
 
     ;; If we are not on the identifier, the ali file was not up-to-date.
--- a/lisp/progmodes/ebrowse.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/progmodes/ebrowse.el	Sat Aug 22 19:29:18 2009 +0000
@@ -1,7 +1,7 @@
 ;;; ebrowse.el --- Emacs C++ class browser & tags facility
 
 ;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;;   2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 ;; Free Software Foundation Inc.
 
 ;; Author: Gerd Moellmann <gerd@gnu.org>
@@ -1337,7 +1337,8 @@
   (setf ebrowse--show-file-names-flag (not ebrowse--show-file-names-flag))
   (let ((old-line (count-lines (point-min) (point))))
     (ebrowse-redraw-tree)
-    (goto-line old-line)))
+    (goto-char (point-min))
+    (forward-line (1- old-line))))
 
 
 
@@ -4316,7 +4317,8 @@
   (interactive)
   (let* ((maxlin (count-lines (point-min) (point-max)))
 	 (n (min maxlin (+ 2 (string-to-number (this-command-keys))))))
-    (goto-line n)
+    (goto-char (point-min))
+    (forward-line (1- n))
     (throw 'electric-buffer-menu-select (point))))
 
 
--- a/lisp/progmodes/gud.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/progmodes/gud.el	Sat Aug 22 19:29:18 2009 +0000
@@ -1,12 +1,12 @@
 ;;; gud.el --- Grand Unified Debugger mode for running GDB and other debuggers
 
+;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2003,
+;;  2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+
 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
 ;; Maintainer: FSF
 ;; Keywords: unix, tools
 
-;; Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2003,
-;;  2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
-
 ;; This file is part of GNU Emacs.
 
 ;; GNU Emacs is free software: you can redistribute it and/or modify
@@ -2715,7 +2715,8 @@
 		    (setq gud-keep-buffer t)))
 	    (save-restriction
 	      (widen)
-	      (goto-line line)
+	      (goto-char (point-min))
+	      (forward-line (1- line))
 	      (setq pos (point))
 	      (or gud-overlay-arrow-position
 		  (setq gud-overlay-arrow-position (make-marker)))
--- a/lisp/progmodes/idlw-shell.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/progmodes/idlw-shell.el	Sat Aug 22 19:29:18 2009 +0000
@@ -1,7 +1,7 @@
 ;; idlw-shell.el --- run IDL as an inferior process of Emacs.
 
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-;;    Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+;;   2009  Free Software Foundation, Inc.
 
 ;; Authors: J.D. Smith <jdsmith@as.arizona.edu>
 ;;          Carsten Dominik <dominik@astro.uva.nl>
@@ -2317,7 +2317,8 @@
    (frame
     (set-buffer (idlwave-find-file-noselect (car frame) 'shell))
     (widen)
-    (goto-line (nth 1 frame)))))
+    (goto-char (point-min))
+    (forward-line (1- (nth 1 frame))))))
 
 (defun idlwave-shell-pc-frame ()
   "Returns the frame for IDL execution."
@@ -2388,8 +2389,8 @@
           (set-buffer buffer)
           (save-restriction
             (widen)
-            (goto-line (nth 1 frame))
-	    (forward-line 0)
+            (goto-char (point-min))
+            (forward-line (1- (nth 1 frame)))
             (setq pos (point))
 	    (setq idlwave-shell-is-stopped t)
 
--- a/lisp/progmodes/vhdl-mode.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/progmodes/vhdl-mode.el	Sat Aug 22 19:29:18 2009 +0000
@@ -15152,7 +15152,8 @@
     (let ((buffer (get-file-buffer (car token))))
       (speedbar-find-file-in-frame (car token))
       (when (or vhdl-speedbar-jump-to-unit buffer)
-	(goto-line (cdr token))
+	(goto-char (point-min))
+	(forward-line (1- (cdr token)))
 	(recenter))
       (vhdl-speedbar-update-current-unit t t)
       (speedbar-set-timer dframe-update-speed)
@@ -15170,7 +15171,8 @@
 	      (let ((token (get-text-property
 			    (match-beginning 3) 'speedbar-token)))
 		(vhdl-visit-file (car token) t
-				 (progn (goto-line (cdr token))
+				 (progn (goto-char (point-min))
+					(forward-line (1- (cdr token)))
 					(end-of-line)
 					(if is-entity
 					    (vhdl-port-copy)
@@ -15919,7 +15921,8 @@
     ;; insert component declarations
     (while ent-alist
       (vhdl-visit-file (nth 2 (car ent-alist)) nil
-		       (progn (goto-line (nth 3 (car ent-alist)))
+		       (progn (goto-char (point-min))
+			      (forward-line (1- (nth 3 (car ent-alist))))
 			      (end-of-line)
 			      (vhdl-port-copy)))
       (goto-char component-pos)
--- a/lisp/server.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/server.el	Sat Aug 22 19:29:18 2009 +0000
@@ -1,7 +1,8 @@
 ;;; server.el --- Lisp code for GNU Emacs running as server process
 
 ;; Copyright (C) 1986, 1987, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-;;   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;;   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;;   Free Software Foundation, Inc.
 
 ;; Author: William Sommerfeld <wesommer@athena.mit.edu>
 ;; Maintainer: FSF
@@ -1098,7 +1099,8 @@
   "Move point to the position indicated in LINE-COL.
 LINE-COL should be a pair (LINE . COL)."
   (when line-col
-    (goto-line (car line-col))
+    (goto-char (point-min))
+    (forward-line (1- (car line-col)))
     (let ((column-number (cdr line-col)))
       (when (> column-number 0)
         (move-to-column (1- column-number))))))
--- a/lisp/startup.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/startup.el	Sat Aug 22 19:29:18 2009 +0000
@@ -2258,8 +2258,9 @@
 		     (if (= file-count 1)
 			 (setq first-file-buffer (find-file file))
 		       (find-file-other-window file)))
-		   (or (zerop line)
-		       (goto-line line))
+		   (unless (zerop line)
+		     (goto-char (point-min))
+		     (forward-line (1- line)))
 		   (setq line 0)
 		   (unless (< column 1)
 		     (move-to-column (1- column)))
@@ -2292,8 +2293,9 @@
 				   (inhibit-startup-screen
 				    (find-file-other-window file))
 				   (t (find-file file))))
-			   (or (zerop line)
-			       (goto-line line))
+			   (unless (zerop line)
+			     (goto-char (point-min))
+			     (forward-line (1- line)))
 			   (setq line 0)
 			   (unless (< column 1)
 			     (move-to-column (1- column)))
--- a/lisp/strokes.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/strokes.el	Sat Aug 22 19:29:18 2009 +0000
@@ -1187,14 +1187,16 @@
 		       (let ((char (or (car rainbow-chars) ?\.)))
 			 (loop for i from 0 to 2 do
 			       (loop for j from 0 to 2 do
-				     (goto-line (+ 16 i y))
+				     (goto-char (point-min))
+				     (forward-line (+ 15 i y))
 				     (forward-char (+ 1 j x))
 				     (delete-char 1)
 				     (insert char)))
 			 (setq rainbow-chars (cdr rainbow-chars)
 			       lift-flag nil))
 		     ;; Otherwise, just plot the point...
-		     (goto-line (+ 17 y))
+		     (goto-char (point-min))
+		     (forward-line (+ 16 y))
 		     (forward-char (+ 2 x))
 		     (subst-char-in-region (point) (1+ (point)) ?\s ?\*)))
 		  ((strokes-lift-p point)
--- a/lisp/term.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/term.el	Sat Aug 22 19:29:18 2009 +0000
@@ -3465,7 +3465,8 @@
       (set-buffer buffer)
       (save-restriction
 	(widen)
-	(goto-line line)
+	(goto-char (point-min))
+	(forward-line (1- line))
 	(setq pos (point))
 	(setq overlay-arrow-string "=>")
 	(or overlay-arrow-position
--- a/lisp/textmodes/picture.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/textmodes/picture.el	Sat Aug 22 19:29:18 2009 +0000
@@ -1,7 +1,7 @@
 ;;; picture.el --- "Picture mode" -- editing using quarter-plane screen model
 
-;; Copyright (C) 1985, 1994, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+;;   2008, 2009  Free Software Foundation, Inc.
 
 ;; Author: K. Shane Hartman
 ;; Maintainer: FSF
@@ -559,7 +559,8 @@
          (left   (min c1 c2))
          (top    (min r1 r2))
          (bottom (max r1 r2)))
-    (goto-line top)
+    (goto-char (point-min))
+    (forward-line (1- top))
     (move-to-column left t)
     (picture-update-desired-column t)
 
@@ -580,7 +581,8 @@
     (picture-insert picture-rectangle-v (- (picture-current-line) top))
 
     (picture-set-motion pvs phs)
-    (goto-line sl)
+    (goto-char (point-min))
+    (forward-line (1- sl))
     (move-to-column sc t)))
 
 
--- a/lisp/textmodes/reftex-index.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/textmodes/reftex-index.el	Sat Aug 22 19:29:18 2009 +0000
@@ -1088,7 +1088,8 @@
   "Go to the CHAR section in the index."
   (let ((pos (point))
         (case-fold-search nil))
-    (goto-line 3)
+    (goto-char (point-min))
+    (forward-line 2)
     (if (re-search-forward (concat "^" (char-to-string char)) nil t)
         (progn
           (beginning-of-line)
--- a/lisp/textmodes/reftex-sel.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/textmodes/reftex-sel.el	Sat Aug 22 19:29:18 2009 +0000
@@ -39,7 +39,7 @@
 (defun reftex-select-label-mode ()
   "Major mode for selecting a label in a LaTeX document.
 This buffer was created with RefTeX.
-It only has a meaningful keymap when you are in the middle of a 
+It only has a meaningful keymap when you are in the middle of a
 selection process.
 To select a label, move the cursor to it and press RET.
 Press `?' for a summary of important key bindings.
@@ -70,7 +70,7 @@
 (defun reftex-select-bib-mode ()
   "Major mode for selecting a citation key in a LaTeX document.
 This buffer was created with RefTeX.
-It only has a meaningful keymap when you are in the middle of a 
+It only has a meaningful keymap when you are in the middle of a
 selection process.
 In order to select a citation, move the cursor to it and press RET.
 Press `?' for a summary of important key bindings.
@@ -263,7 +263,7 @@
               note    (nth 5 cell))
 
         (when (and labels
-                   (or (eq labels t) 
+                   (or (eq labels t)
                        (string= typekey labels)
                        (string= labels " "))
                    (or show-commented (null comment)))
@@ -297,7 +297,7 @@
           (put-text-property from to :data cell)
           (when mouse-face
             (put-text-property from (1- to)
-                               'mouse-face mouse-face))   
+                               'mouse-face mouse-face))
           (goto-char to)))
 
        ((eq (car cell) 'index)
@@ -315,7 +315,7 @@
 
           (when font
             (setq to (point))
-            (put-text-property 
+            (put-text-property
              (- (point) (length (nth 7 cell))) to
              'face index-face)
             (goto-char to))
@@ -328,10 +328,10 @@
           (put-text-property from to :data cell)
           (when mouse-face
             (put-text-property from (1- to)
-                               'mouse-face mouse-face))   
+                               'mouse-face mouse-face))
           (goto-char to))))
 
-      (if (eq cell here-I-am) 
+      (if (eq cell here-I-am)
           (setq offset 'attention))
       (if (and prev-inserted (eq offset 'attention))
           (setq offset prev-inserted))
@@ -358,11 +358,12 @@
          ((listp loc)
           (setq pos (text-property-any (point-min) (point-max) :data loc))
           (when pos
-            (goto-char pos) 
+            (goto-char pos)
             (throw 'exit t)))
          ((integerp loc)
           (when (<= loc (count-lines (point-min) (point-max)))
-            (goto-line loc)
+            (goto-char (point-min))
+            (forward-line (1- loc))
             (throw 'exit t)))))
       (goto-char fallback))))
 
@@ -395,7 +396,7 @@
               (setq truncate-lines t)
 
               ;; Find a good starting point
-              (reftex-find-start-point 
+              (reftex-find-start-point
                (point-min) offset reftex-last-data reftex-last-line)
               (beginning-of-line 1)
               (set (make-local-variable 'reftex-last-follow-point) (point))
@@ -452,11 +453,11 @@
   (let (b e)
     (setq data (get-text-property (point) :data))
     (setq last-data (or data last-data))
-  
+
     (when (and data cb-flag
                (not (equal reftex-last-follow-point (point))))
       (setq reftex-last-follow-point (point))
-      (funcall call-back data reftex-callback-fwd 
+      (funcall call-back data reftex-callback-fwd
                (not reftex-revisit-to-follow)))
     (if data
         (setq b (or (previous-single-property-change
@@ -525,7 +526,8 @@
       (goto-char pos))
      ((and (local-variable-p 'reftex-last-line (current-buffer))
            (integerp reftex-last-line))
-      (goto-line reftex-last-line))
+      (goto-char (point-min))
+      (forward-line (1- reftex-last-line)))
      (t (ding)))))
 (defun reftex-select-toggle-follow ()
   "Toggle follow mode:  Other window follows with full context."
@@ -576,7 +578,7 @@
 (defun reftex-select-read-label ()
   "Use minibuffer to read a label to reference, with completion."
   (interactive)
-  (let ((label (completing-read 
+  (let ((label (completing-read
                 "Label: " (symbol-value reftex-docstruct-symbol)
                 nil nil reftex-prefix)))
     (unless (or (equal label "") (equal label reftex-prefix))
@@ -676,7 +678,7 @@
           ([(up)]     . reftex-select-previous)
           ("f"        . reftex-select-toggle-follow)
           ("\C-m"     . reftex-select-accept)
-          ([(return)] . reftex-select-accept) 
+          ([(return)] . reftex-select-accept)
           ("q"        . reftex-select-quit)
           ("."        . reftex-select-show-insertion-point)
           ("?"        . reftex-select-help))
@@ -687,7 +689,7 @@
       (define-key map [(button2)] 'reftex-select-mouse-accept)
     (define-key map [(mouse-2)] 'reftex-select-mouse-accept)
     (define-key map [follow-link] 'mouse-face))
-    
+
 
   ;; Digit arguments
   (loop for key across "0123456789" do
@@ -701,7 +703,7 @@
 ;; Specific bindings in reftex-select-label-map
 (loop for key across "aAcgFlrRstx#%" do
       (define-key reftex-select-label-map (vector (list key))
-        (list 'lambda '() 
+        (list 'lambda '()
               "Press `?' during selection to find out about this key."
               '(interactive) (list 'throw '(quote myexit) key))))
 
@@ -725,7 +727,7 @@
 ;; Specific bindings in reftex-select-bib-map
 (loop for key across "grRaAeE" do
       (define-key reftex-select-bib-map (vector (list key))
-        (list 'lambda '() 
+        (list 'lambda '()
               "Press `?' during selection to find out about this key."
               '(interactive) (list 'throw '(quote myexit) key))))
 
@@ -735,7 +737,7 @@
         ("m"     . reftex-select-mark)
         ("u"     . reftex-select-unmark))
       do (define-key reftex-select-bib-map (car x) (cdr x)))
-  
+
 
 ;; arch-tag: 842078ff-0586-4e0b-957e-536e08218464
 ;;; reftex-sel.el ends here
--- a/lisp/textmodes/reftex-toc.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/textmodes/reftex-toc.el	Sat Aug 22 19:29:18 2009 +0000
@@ -1,6 +1,7 @@
 ;;; reftex-toc.el --- RefTeX's table of contents mode
-;; Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005,
-;;   2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+
+;; Copyright (C) 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006, 2007,
+;;   2008, 2009  Free Software Foundation, Inc.
 
 ;; Author: Carsten Dominik <dominik@science.uva.nl>
 ;; Maintainer: auctex-devel@gnu.org
@@ -149,7 +150,7 @@
                          (frame-parameter (selected-frame) 'unsplittable)))
          offset toc-window)
 
-    (if (setq toc-window (get-buffer-window 
+    (if (setq toc-window (get-buffer-window
                           "*toc*"
                           (if reuse 'visible)))
         (select-window toc-window)
@@ -165,7 +166,7 @@
             (split-window-horizontally
              (floor (* (window-width)
                        reftex-toc-split-windows-fraction)))
-          (split-window-vertically 
+          (split-window-vertically
            (floor (* (window-height)
                      reftex-toc-split-windows-fraction)))))
 
@@ -210,11 +211,11 @@
              reftex-toc-include-context
              nil ; counter
              nil ; commented
-             here-I-am 
+             here-I-am
              ""     ; xr-prefix
              t      ; a toc buffer
              ))
-       
+
       (run-hooks 'reftex-display-copied-context-hook)
       (message "Building *toc* buffer...done.")
       (setq buffer-read-only t))
@@ -226,12 +227,12 @@
                                    t
                                    reftex-toc-include-index-entries
                                    reftex-toc-include-file-boundaries)
-                (reftex-last-assoc-before-elt 
+                (reftex-last-assoc-before-elt
                  'toc here-I-am
                  (symbol-value reftex-docstruct-symbol))))
       (put 'reftex-toc :reftex-line 3)
-      (goto-line 3)
-      (beginning-of-line)))
+      (goto-char (point-min))
+      (forward-line 2)))
 
     ;; Find the correct starting point
     (reftex-find-start-point (point) offset (get 'reftex-toc :reftex-line))
@@ -251,7 +252,7 @@
          (not (get-text-property (point) 'intangible))
          (memq reftex-highlight-selection '(cursor both))
          (reftex-highlight 2
-                           (or (previous-single-property-change 
+                           (or (previous-single-property-change
                                 (min (point-max) (1+ (point))) :data)
                                (point-min))
                            (or (next-single-property-change (point) :data)
@@ -298,10 +299,10 @@
                (window-height))))))
 
 (defun reftex-toc-dframe-p (&optional frame error)
-  ;; Check if FRAME is the dedicated TOC frame.  
+  ;; Check if FRAME is the dedicated TOC frame.
   ;; If yes, and ERROR is non-nil, throw an error.
   (setq frame (or frame (selected-frame)))
-  (let ((res (equal 
+  (let ((res (equal
               (if (fboundp 'frame-property)
                   (frame-property frame 'name)
                 (frame-parameter  frame 'name))
@@ -327,7 +328,7 @@
   (when (featurep 'xemacs) (setq zmacs-region-stays t))
   (setq reftex-callback-fwd t)
   (or (eobp) (forward-char 1))
-  (goto-char (or (next-single-property-change (point) :data) 
+  (goto-char (or (next-single-property-change (point) :data)
                  (point))))
 (defun reftex-toc-previous (&optional arg)
   "Move to previous selectable item."
@@ -364,7 +365,7 @@
 With prefix ARG, prompt for a label type and include only labels of
 that specific type."
   (interactive "P")
-  (setq reftex-toc-include-labels 
+  (setq reftex-toc-include-labels
         (if arg (reftex-query-label-type)
           (not reftex-toc-include-labels)))
   (reftex-toc-revert))
@@ -468,7 +469,7 @@
 (defun reftex-toc-rescan (&rest ignore)
   "Regenerate the *toc* buffer by reparsing file of section at point."
   (interactive)
-  (if (and reftex-enable-partial-scans 
+  (if (and reftex-enable-partial-scans
            (null current-prefix-arg))
       (let* ((data (get-text-property (point) :data))
              (what (car data))
@@ -502,7 +503,7 @@
 (defun reftex-toc-revert (&rest ignore)
   "Regenerate the *toc* from the internal lists."
   (interactive)
-  (let ((unsplittable 
+  (let ((unsplittable
          (if (fboundp 'frame-property)
              (frame-property (selected-frame) 'unsplittable)
            (frame-parameter (selected-frame) 'unsplittable)))
@@ -596,7 +597,7 @@
             (goto-char start-pos)
             (setq sections (reftex-toc-extract-section-number (car entries)))
             (if (> (setq nsec (length entries)) 1)
-                (setq sections 
+                (setq sections
                       (concat sections "-"
                               (reftex-toc-extract-section-number
                                (nth (1- nsec) entries)))))
@@ -621,17 +622,20 @@
             (save-window-excursion
               (reftex-toc-Rescan))
             (reftex-toc-restore-region start-line mark-line)
-            (message "%d section%s %smoted" 
+            (message "%d section%s %smoted"
                      nsec (if (= 1 nsec) "" "s") pro-or-de)
             nil))
     (if msg (progn (ding) (message "%s" msg)))))
 
 
 (defun reftex-toc-restore-region (point-line &optional mark-line)
-  (if mark-line
-      (progn (goto-line mark-line)
-             (setq mpos (point))))
-  (if point-line (goto-line point-line))
+  (when mark-line
+    (goto-char (point-min))
+    (forward-line (1- mark-line))
+    (setq mpos (point)))
+  (when point-line
+    (goto-char (point-min))
+    (forward-line (1- point-line)))
   (if mark-line
       (progn
         (set-mark mpos)
@@ -781,7 +785,7 @@
         (error "This is not a label entry."))
     (setq newlabel (read-string (format "Rename label \"%s\" to:" label)))
     (if (assoc newlabel (symbol-value reftex-docstruct-symbol))
-        (if (not (y-or-n-p 
+        (if (not (y-or-n-p
                   (format "Label '%s' exists. Use anyway? " label)))
             (error "Abort")))
     (save-excursion
@@ -791,7 +795,7 @@
             (reftex-query-replace-document
              (concat "{" (regexp-quote label) "}")
              (format "{%s}" newlabel))
-          (error t))))        
+          (error t))))
     (reftex-toc-rescan)))
 
 
@@ -810,9 +814,9 @@
          show-window show-buffer match)
 
     (unless toc (error "Don't know which toc line to visit"))
-    
+
     (cond
-  
+
      ((eq (car toc) 'toc)
       ;; a toc entry
       (setq match (reftex-toc-find-section toc no-revisit)))
@@ -828,7 +832,7 @@
                   (file (nth 1 toc)))
               (if (or (not no-revisit) (reftex-get-buffer-visiting file))
                   (progn
-                    (switch-to-buffer-other-window 
+                    (switch-to-buffer-other-window
                      (reftex-get-file-buffer-force file nil))
                     (goto-char (if (eq where 'bof) (point-min) (point-max))))
                 (message "%s" reftex-no-follow-message) nil))))
@@ -881,8 +885,8 @@
                 (looking-at (reftex-make-desperate-section-regexp literal))
                 (looking-at (concat "\\\\"
                                     (regexp-quote
-                                     (car 
-                                      (rassq level 
+                                     (car
+                                      (rassq level
                                              reftex-section-levels-all)))
                                     "[[{]?"))))
            ((or (not no-revisit)
@@ -1056,7 +1060,7 @@
       (define-key reftex-toc-map (vector (list key)) 'digit-argument))
 (define-key reftex-toc-map "-" 'negative-argument)
 
-(easy-menu-define 
+(easy-menu-define
  reftex-toc-menu reftex-toc-map
  "Menu for Table of Contents buffer"
  '("TOC"
@@ -1089,7 +1093,7 @@
     ["Context" reftex-toc-toggle-context :style toggle
      :selected reftex-toc-include-context]
     "--"
-    ["Follow Mode" reftex-toc-toggle-follow :style toggle 
+    ["Follow Mode" reftex-toc-toggle-follow :style toggle
      :selected reftex-toc-follow-mode]
     ["Auto Recenter" reftex-toggle-auto-toc-recenter :style toggle
      :selected reftex-toc-auto-recenter-timer]
--- a/lisp/textmodes/rst.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/textmodes/rst.el	Sat Aug 22 19:29:18 2009 +0000
@@ -1398,7 +1398,8 @@
       (let (m line)
         (while (and cur (< (setq line (caar cur)) region-end-line))
           (setq m (make-marker))
-          (goto-line line)
+          (goto-char (point-min))
+          (forward-line (1- line))
           (push (list (set-marker m (point)) (cdar cur)) marker-list)
           (setq cur (cdr cur)) ))
 
@@ -1463,7 +1464,8 @@
 				(lambda (deco)
 				  (cons (rst-position (cdr deco) hier)
 					(let ((m (make-marker)))
-					  (goto-line (car deco))
+					  (goto-char (point-min))
+					  (forward-line (1- (car deco)))
 					  (set-marker m (point))
 					  m)))
 				alldecos))
@@ -1497,7 +1499,8 @@
       ;; adjust for the changes in the document.
       (dolist (deco (nreverse alldecos))
 	;; Go to the appropriate position.
-	(goto-line (car deco))
+	(goto-char (point-min))
+	(forward-line (1- (car deco)))
 	(insert "@\n")
 ;; FIXME: todo, we
 	)
@@ -1628,7 +1631,8 @@
     (save-excursion
       (setq lines
             (mapcar (lambda (deco)
-                      (goto-line (car deco))
+                      (goto-char (point-min))
+                      (forward-line (1- (car deco)))
                       (list (gethash (cons (cadr deco) (caddr deco)) levels)
                             (rst-get-stripped-line)
                             (let ((m (make-marker)))
@@ -2019,7 +2023,8 @@
     (set (make-local-variable 'rst-toc-return-buffer) curbuf)
 
     ;; Move the cursor near the right section in the TOC.
-    (goto-line line)
+    (goto-char (point-min))
+    (forward-line (1- line))
     ))
 
 
@@ -2134,7 +2139,9 @@
     ;; If the index is positive, goto the line, otherwise go to the buffer
     ;; boundaries.
     (if (and cur (>= idx 0))
-        (goto-line (car cur))
+        (progn
+          (goto-char (point-min))
+          (forward-line (1- (car cur))))
       (if (> offset 0) (goto-char (point-max)) (goto-char (point-min))))
     ))
 
--- a/lisp/textmodes/tex-mode.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/textmodes/tex-mode.el	Sat Aug 22 19:29:18 2009 +0000
@@ -2210,7 +2210,7 @@
 		    (with-syntax-table tex-error-parse-syntax-table
 		      (backward-up-list 1)
 		      (skip-syntax-forward "(_")
-		      (while (not 
+		      (while (not
 			      (and (setq try-filename (thing-at-point
 						       'filename))
 				   (not (string= "" try-filename))
@@ -2229,7 +2229,10 @@
 		    (find-file-noselect filename))
 		(save-excursion
 		  (if new-file
-		      (progn (goto-line linenum) (setq last-position nil))
+		      (progn
+			(goto-char (point-min))
+			(forward-line (1- linenum))
+			(setq last-position nil))
 		    (goto-char last-position)
 		    (forward-line (- linenum last-linenum)))
 		  ;; first try a forward search for the error text,
--- a/lisp/textmodes/two-column.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/textmodes/two-column.el	Sat Aug 22 19:29:18 2009 +0000
@@ -537,7 +537,8 @@
     (if (get-buffer-window (2C-other t))
 	(select-window (get-buffer-window (2C-other)))
       (switch-to-buffer (2C-other)))
-    (newline (goto-line line))
+    (goto-char (point-min))
+    (newline (forward-line (1- line)))
     (if col
 	(move-to-column col)
       (end-of-line 1))))
--- a/lisp/view.el	Sat Aug 22 19:21:18 2009 +0000
+++ b/lisp/view.el	Sat Aug 22 19:29:18 2009 +0000
@@ -817,7 +817,8 @@
 Also set the mark at the position where point was."
   (interactive "p")
   (push-mark)
-  (goto-line line)
+  (goto-char (point-min))
+  (forward-line (1- line))
   (view-recenter))
 
 (defun View-back-to-mark (&optional ignore)