[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*print-lines* truncation overflows the right-margin

[This using the new-pretty-printer in version 16]

In the following, note that the first test wraps correctly, but the second
sometimes overflows the margin; it appears to be calculating for the
non-truncated case and then just slamming on the " ..)" without ever
considering it in the width of the line.  [XP gets this correct but exhibits
other annoying bugs during the same test]

    (defun print-lines-test (thing &optional (lines *print-lines*))
      (let ((*print-lines* lines)
	    (*print-right-margin* 80))
	(prin1 thing) (terpri)
	(do ((string "" (concatenate 'string string (car words)))
	     (words '("In" " the" " sunshine" " of" " time" ", mankind"
		      " says" " to" " refresh" " thine" " eyes")
		    (cdr words)))
	    ((null words))
	  (format t "~a: ~s~%" string thing))))

    (let ((vec (make-sequence 'vector 40 :initial-element nil)))
      (print-lines-test vec)
      (print-lines-test vec 1))


Miles Bader  --  HCRC, University of Edinburgh  --  Miles.Bader@ed.ac.uk
Ich bin ein Virus. Mach' mit und kopiere mich in Deine .signature.
94% of everything is grunge