Change M-x goto-char from 0-based to 1-based indexing. Move M-x
authorChris Hanson <org/chris-hanson/cph>
Fri, 10 May 1991 05:12:13 +0000 (05:12 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 10 May 1991 05:12:13 +0000 (05:12 +0000)
goto-line and M-x goto-page from this file to "lincom.scm".

v7/src/edwin/motcom.scm

index 7a42a85dbe6d1919bcf49193c90870668116c669..84fe0ea46f7307cdc75946c75e2daad12ee52d15 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/motcom.scm,v 1.40 1991/05/02 01:13:59 cph Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/motcom.scm,v 1.41 1991/05/10 05:12:13 cph Exp $
 ;;;
 ;;;    Copyright (c) 1985, 1989-91 Massachusetts Institute of Technology
 ;;;
@@ -105,33 +105,13 @@ With arg from 0 to 10, goes up that many tenths of the file from the end."
 (define (region-10ths region n)
   (mark+ (region-start region)
         (quotient (* n (region-count-chars region)) 10)))
-\f
-(define-command goto-char
-  "Goto the Nth character from the start of the buffer."
-  "p"
-  (lambda (argument)
-    (let ((mark (mark+ (buffer-start (current-buffer)) (-1+ argument))))
-      (if mark
-         (set-current-point! mark)
-         (editor-error)))))
-
-(define-command goto-line
-  "Goto the Nth line from the start of the buffer."
-  "p"
-  (lambda (argument)
-    (let ((mark (line-start (buffer-start (current-buffer)) (-1+ argument))))
-      (if mark
-         (set-current-point! mark)
-         (editor-error)))))
 
-(define-command goto-page
-  "Goto the Nth page from the start of the buffer."
-  "p"
-  (lambda (argument)
-    (let ((mark (forward-page (buffer-start (current-buffer)) (-1+ argument))))
-      (if mark
-         (set-current-point! mark)
-         (editor-error)))))
+(define-command goto-char
+  "Goto line ARG, counting from char 1 at beginning of buffer."
+  "NGoto char"
+  (lambda (n)
+    (set-current-point!
+     (mark+ (buffer-start (current-buffer)) (- n 1) 'ERROR))))
 \f
 (define-variable goal-column
   "Semipermanent goal column for vertical motion,