(line (file-location-line location))
(filename (file-location-filename location)))
(cond (line
- (format stream "~&#line ~D~@[ ~S~]~%" line filename)
+ (when (typep stream 'position-aware-stream)
+ (format stream "~&#line ~D~@[ ~S~]~%" line filename))
(funcall thunk)
(when (typep stream 'position-aware-stream)
(fresh-line stream)