From f705c517d8606a9a72edd11a96725f9c4e4be93d Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Wed, 6 Oct 2004 17:01:05 +0000 Subject: [PATCH] 0.8.15.10: Fix PPRINT-TAB (as implemented by COMPUTE-TAB-SIZE). ... it was, well, completely wrong. --- NEWS | 2 ++ src/code/pprint.lisp | 18 ++++++++++-------- version.lisp-expr | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index 7ae1f6f..33bd0ce 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,8 @@ changes in sbcl-0.8.16 relative to sbcl-0.8.15: ** *PRINT-LEVEL* handling for slotless structures is pedantically correct. ** PPRINT-INDENT accepts a request for an indentation of any REAL. + ** PPRINT-TAB (and the FORMAT ~T directive) now indent by the + correct amounts. changes in sbcl-0.8.15 relative to sbcl-0.8.14: * incompatible change: SB-INT:*BEFORE-SAVE-INITIALIZATIONS* and diff --git a/src/code/pprint.lisp b/src/code/pprint.lisp index 57024e6..5032ecb 100644 --- a/src/code/pprint.lisp +++ b/src/code/pprint.lisp @@ -364,21 +364,23 @@ ;;;; tab support (defun compute-tab-size (tab section-start column) - (let ((origin (if (tab-sectionp tab) section-start 0)) - (colnum (tab-colnum tab)) - (colinc (tab-colinc tab))) + (let* ((origin (if (tab-sectionp tab) section-start 0)) + (colnum (tab-colnum tab)) + (colinc (tab-colinc tab)) + (position (- column origin))) (cond ((tab-relativep tab) (unless (<= colinc 1) - (let ((newposn (+ column colnum))) + (let ((newposn (+ position colnum))) (let ((rem (rem newposn colinc))) (unless (zerop rem) (incf colnum (- colinc rem)))))) colnum) - ((<= column (+ colnum origin)) - (- (+ colnum origin) column)) - (t + ((< position colnum) + (- colnum position)) + ((zerop colinc) 0) + (t (- colinc - (rem (- column origin) colinc)))))) + (rem (- position colnum) colinc)))))) (defun index-column (index stream) (let ((column (pretty-stream-buffer-start-column stream)) diff --git a/version.lisp-expr b/version.lisp-expr index 2b2b429..c873ecc 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.15.9" +"0.8.15.10" -- 1.7.10.4