X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fpprint.lisp;h=8c084d63ac546d764dca1be6bb114aae65f9dde6;hb=558e7ce44e6a8305474dc55adbdbc1f7119c9a5e;hp=57024e69e9dae44d56849ddbe70a912e85397fbc;hpb=dd2cc7dffe4e37177f5c8019f561130abd41d93e;p=sbcl.git diff --git a/src/code/pprint.lisp b/src/code/pprint.lisp index 57024e6..8c084d6 100644 --- a/src/code/pprint.lisp +++ b/src/code/pprint.lisp @@ -119,7 +119,7 @@ (defun pretty-out (stream char) (declare (type pretty-stream stream) - (type base-char char)) + (type character char)) (cond ((char= char #\newline) (enqueue-newline stream :literal)) (t @@ -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)) @@ -660,15 +662,15 @@ *STANDARD-OUTPUT*) if it is a pretty-printing stream, and do nothing if not. KIND can be one of: :LINEAR - A line break is inserted if and only if the immediatly - containing section cannot be printed on one line. + containing section cannot be printed on one line. :MISER - Same as LINEAR, but only if ``miser-style'' is in effect. - (See *PRINT-MISER-WIDTH*.) + (See *PRINT-MISER-WIDTH*.) :FILL - A line break is inserted if and only if either: (a) the following section cannot be printed on the end of the - current line, + current line, (b) the preceding section was not printed on a single line, or (c) the immediately containing section cannot be printed on one - line and miser-style is in effect. + line and miser-style is in effect. :MANDATORY - A line break is always inserted. When a line break is inserted by any type of conditional newline, any blanks that immediately precede the conditional newline are ommitted @@ -692,7 +694,7 @@ and do nothing if not. (See PPRINT-LOGICAL-BLOCK.) N is the indentation to use (in ems, the width of an ``m'') and RELATIVE-TO can be either: :BLOCK - Indent relative to the column the current logical block - started on. + started on. :CURRENT - Indent relative to the current column. The new indentation value does not take effect until the following line break."