Changeset 13368


Ignore:
Timestamp:
Jan 8, 2010, 7:49:53 AM (9 years ago)
Author:
gb
Message:

Define LINE-LENGTH in terms of STREAM-LINE-LENGTH, which may actually
return a non-constant value ...

Add a LINE-LENGTH slot to STRING-OUTPUT-STREAM-IOBLOCKs; define
STREAM-LINE-LENGTH and (SETF STREAM-LINE-LENGTH) on STRING-OUTPUT-STREAMs
in terms of it.

Hair up %BREAK-MESSAGE, to try to minimize interactions between some types
of indentation done by the "condition reporter" and the indentation done
by the caller (%BREAK-MESSAGE itself.) See ticket:642.

Location:
trunk/source
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-readloop-lds.lisp

    r13345 r13368  
    561561        (*print-right-margin* nil)
    562562        (*signal-printing-errors* nil)
    563         (s (make-indenting-string-output-stream prefixchar nil)))
     563        (s (make-indenting-string-output-stream prefixchar nil))
     564        (sub (make-string-output-stream))
     565        (indent 0))
    564566    (format s "~A ~A: " prefixchar msg)
    565     (setf (indenting-string-output-stream-indent s) (column s))
     567    (setf (indenting-string-output-stream-indent s) (setq indent (column s)))
     568    (decf (stream-line-length sub) indent)
    566569    ;(format s "~A" condition) ; evil if circle
    567     (report-condition condition s)
     570    (report-condition condition sub)
     571    (format s "~A" (get-output-stream-string sub))
    568572    (if (not (and (typep condition 'simple-program-error)
    569573                  (simple-program-error-context condition)))
  • trunk/source/level-1/l1-streams.lisp

    r13366 r13368  
    42364236(defstruct (string-output-stream-ioblock (:include string-stream-ioblock))
    42374237  (index 0)
    4238   freelist)
     4238  freelist
     4239  (line-length 80))
    42394240
    42404241(defstatic *string-output-stream-class* (make-built-in-class 'string-output-stream 'string-stream 'basic-character-output-stream))
     
    42534254(defmethod stream-clear-output ((s string-output-stream))
    42544255  nil)
     4256
     4257(defmethod stream-line-length ((s string-output-stream))
     4258  (let* ((ioblock (basic-stream-ioblock s)))
     4259    (string-output-stream-ioblock-line-length ioblock)))
     4260
     4261(defmethod (setf stream-line-length) (newlen (s string-output-stream))
     4262  (let* ((ioblock (basic-stream-ioblock s)))
     4263    (setf (string-output-stream-ioblock-line-length ioblock) newlen)))
     4264
    42554265
    42564266;;; Should only be used for a stream whose class is exactly
     
    42904300                                   (ioblock-device data) -1
    42914301                                   (ioblock-charpos data) 0
    4292                                    (string-output-stream-ioblock-index data) 0))
     4302                                   (string-output-stream-ioblock-index data) 0
     4303                                   (string-output-stream-ioblock-line-length data) 80))
    42934304                           data)))))
    42944305    (or recycled (apply #'make-string-output-stream-ioblock keys))))
  • trunk/source/lib/streams.lisp

    r13067 r13368  
    131131
    132132(defun line-length (stream)
    133   (declare (ignore stream))
    134   80)
     133  (or (stream-line-length stream) 80))
    135134
    136135(defun write-byte (byte stream)
Note: See TracChangeset for help on using the changeset viewer.