0.8.15.10:
authorChristophe Rhodes <csr21@cam.ac.uk>
Wed, 6 Oct 2004 17:01:05 +0000 (17:01 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Wed, 6 Oct 2004 17:01:05 +0000 (17:01 +0000)
Fix PPRINT-TAB (as implemented by COMPUTE-TAB-SIZE).
... it was, well, completely wrong.

NEWS
src/code/pprint.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 7ae1f6f..33bd0ce 100644 (file)
--- 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
index 57024e6..5032ecb 100644 (file)
 ;;;; 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))
index 2b2b429..c873ecc 100644 (file)
@@ -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"