From 1b064a28c8470e01214f524754b95d8ffa0c9bbb Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 25 Feb 2000 19:40:00 +0000 Subject: [PATCH] Implement INDENT-TO. --- v7/src/edwin/things.scm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/v7/src/edwin/things.scm b/v7/src/edwin/things.scm index 41346c195..aa4e87deb 100644 --- a/v7/src/edwin/things.scm +++ b/v7/src/edwin/things.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: things.scm,v 1.85 1999/01/02 06:11:34 cph Exp $ +;;; $Id: things.scm,v 1.86 2000/02/25 19:40:00 cph Exp $ ;;; -;;; Copyright (c) 1985, 1989-1999 Massachusetts Institute of Technology +;;; Copyright (c) 1985, 1989-2000 Massachusetts Institute of Technology ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -201,6 +201,15 @@ (let ((point (if (default-object? point) (current-point) point))) (delete-string (horizontal-space-start point) (horizontal-space-end point)))) + +(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)) + point))) (define (region-blank? region) (not (skip-chars-forward " \t" -- 2.25.1