From: Chris Hanson Date: Tue, 4 Apr 2000 16:52:14 +0000 (+0000) Subject: Fix definition of INDENT-TO; was computing target column incorrectly. X-Git-Tag: 20090517-FFI~4106 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=e055cae3061a7823d3c4d36b2290093df773d598;p=mit-scheme.git Fix definition of INDENT-TO; was computing target column incorrectly. --- diff --git a/v7/src/edwin/things.scm b/v7/src/edwin/things.scm index aa4e87deb..53f8035a4 100644 --- a/v7/src/edwin/things.scm +++ b/v7/src/edwin/things.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: things.scm,v 1.86 2000/02/25 19:40:00 cph Exp $ +;;; $Id: things.scm,v 1.87 2000/04/04 16:52:14 cph Exp $ ;;; ;;; Copyright (c) 1985, 1989-2000 Massachusetts Institute of Technology ;;; @@ -159,7 +159,9 @@ (define (compute-horizontal-space c1 c2 tab-width) ;; Compute the number of tabs/spaces required to fill from column C1 - ;; to C2 with whitespace. It is assumed that C1 >= C2. + ;; to C2 with whitespace. + (if (< c1 c2) + (error:bad-range-argument c2 'COMPUTE-HORIZONTAL-SPACE)) (if tab-width (let ((qr1 (integer-divide c1 tab-width)) (qr2 (integer-divide c2 tab-width))) @@ -205,10 +207,8 @@ (define (indent-to target-column #!optional minimum point) (let ((minimum (if (default-object? minimum) 0 minimum)) (point (if (default-object? point) (current-point) point))) - (insert-horizontal-space (let ((n (- target-column (mark-column point)))) - (if (< n minimum) - (+ target-column (- minimum (max 0 n))) - target-column)) + (insert-horizontal-space (max target-column + (+ (mark-column point) minimum)) point))) (define (region-blank? region)