Change SET-WINDOW-POINT! and SET-GROUP-POINT! to modify point's index
authorChris Hanson <org/chris-hanson/cph>
Sun, 6 Nov 2005 16:17:00 +0000 (16:17 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sun, 6 Nov 2005 16:17:00 +0000 (16:17 +0000)
rather than creating a new marker.  Add new procedures
SET-GROUP-POINT-INDEX! and %SET-BUFFER-POINT-INDEX!.

v7/src/edwin/buffer.scm
v7/src/edwin/bufwin.scm
v7/src/edwin/struct.scm

index 20d25cb42d11ab74fd77c2bc1bbc364a2a03a5b1..25ace96b13e8a8d45ec4afca8eadae9eb6b54bd8 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: buffer.scm,v 1.192 2005/03/31 19:00:03 cph Exp $
+$Id: buffer.scm,v 1.193 2005/11/06 16:16:48 cph Exp $
 
 Copyright 1986,1989,1990,1991,1992,1993 Massachusetts Institute of Technology
 Copyright 1994,1995,1996,1998,1999,2000 Massachusetts Institute of Technology
@@ -175,6 +175,9 @@ The buffer is guaranteed to be deselected at that time."
 (define-integrable (%set-buffer-point! buffer mark)
   (set-group-point! (buffer-group buffer) mark))
 
+(define-integrable (%set-buffer-point-index! buffer index)
+  (set-group-point-index! (buffer-group buffer) index))
+
 (define-integrable (minibuffer? buffer)
   (char=? (string-ref (buffer-name buffer) 0) #\Space))
 
index e4a1cdaa3a64dac5eacbf4dc61e3af31371b89c2..4c1b5cc0132afe84b10091f07d2d474088e92165 100644 (file)
@@ -1,8 +1,10 @@
 #| -*-Scheme-*-
 
-$Id: bufwin.scm,v 1.313 2003/02/14 18:28:11 cph Exp $
+$Id: bufwin.scm,v 1.314 2005/11/06 16:16:55 cph Exp $
 
-Copyright 1986, 1989-2000, 2002 Massachusetts Institute of Technology
+Copyright 1987,1989,1990,1991,1992,1993 Massachusetts Institute of Technology
+Copyright 1994,1995,1996,1999,2000,2002 Massachusetts Institute of Technology
+Copyright 2005 Massachusetts Institute of Technology
 
 This file is part of MIT/GNU Scheme.
 
@@ -228,11 +230,14 @@ USA.
   (with-instance-variables buffer-window window (point*)
     (set! point point*)))
 
-(define-integrable (%set-window-point-index! window index)
-  (%set-window-point! window
-                     (make-permanent-mark (%window-group window)
-                                          index
-                                          #t)))
+(define (%set-window-point-index! window index)
+  (let ((point (%window-point window)))
+    (if point
+       (set-mark-index! point index)
+       (%set-window-point! window
+                           (make-permanent-mark (%window-group window)
+                                                index
+                                                #t)))))
 
 (define-integrable (%window-cursor-inferior window)
   (with-instance-variables buffer-window window () cursor-inferior))
index a7201c339f7f3ec062ec33a634e6f2f5e215de61..824a260b669df04e492a133469b65c5019e2eb9f 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: struct.scm,v 1.99 2005/03/31 18:55:57 cph Exp $
+$Id: struct.scm,v 1.100 2005/11/06 16:17:00 cph Exp $
 
 Copyright 1985,1989,1990,1991,1992,1993 Massachusetts Institute of Technology
 Copyright 1994,1999,2000,2001,2003,2005 Massachusetts Institute of Technology
@@ -176,7 +176,10 @@ USA.
         (group-gap-start group))))
 
 (define-integrable (set-group-point! group point)
-  (set-group-%point! group (mark-left-inserting-copy point)))
+  (set-group-point-index! group (mark-index point)))
+
+(define-integrable (set-group-point-index! group index)
+  (set-mark-index! (group-point group) index))
 
 (define (group-absolute-start group)
   (make-temporary-mark group 0 #f))