From 8989e55c80f646740a69fda28d9a23565e794491 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 6 Nov 2005 16:17:00 +0000 Subject: [PATCH] Change SET-WINDOW-POINT! and SET-GROUP-POINT! to modify point's index rather than creating a new marker. Add new procedures SET-GROUP-POINT-INDEX! and %SET-BUFFER-POINT-INDEX!. --- v7/src/edwin/buffer.scm | 5 ++++- v7/src/edwin/bufwin.scm | 19 ++++++++++++------- v7/src/edwin/struct.scm | 7 +++++-- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/v7/src/edwin/buffer.scm b/v7/src/edwin/buffer.scm index 20d25cb42..25ace96b1 100644 --- a/v7/src/edwin/buffer.scm +++ b/v7/src/edwin/buffer.scm @@ -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)) diff --git a/v7/src/edwin/bufwin.scm b/v7/src/edwin/bufwin.scm index e4a1cdaa3..4c1b5cc01 100644 --- a/v7/src/edwin/bufwin.scm +++ b/v7/src/edwin/bufwin.scm @@ -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)) diff --git a/v7/src/edwin/struct.scm b/v7/src/edwin/struct.scm index a7201c339..824a260b6 100644 --- a/v7/src/edwin/struct.scm +++ b/v7/src/edwin/struct.scm @@ -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)) -- 2.25.1