support progress evts in result of `make-limited-input-port'
and also adjust initial position in various port constructions to use `file-position' instead of `port-next-location' original commit: a9190621439b8bf8ecace2fd9e81217dcaed808d
This commit is contained in:
parent
670f2ea435
commit
39d1cf4635
|
@ -529,8 +529,7 @@
|
||||||
(lambda (n evt target-evt) (port-commit-peeked n evt target-evt p)))
|
(lambda (n evt target-evt) (port-commit-peeked n evt target-evt p)))
|
||||||
(lambda () (port-next-location p))
|
(lambda () (port-next-location p))
|
||||||
(lambda () (port-count-lines! p))
|
(lambda () (port-count-lines! p))
|
||||||
(let-values ([(line col pos) (port-next-location p)])
|
(add1 (file-position p)))))
|
||||||
(or pos (file-position p))))))
|
|
||||||
|
|
||||||
;; Not kill-safe.
|
;; Not kill-safe.
|
||||||
(define make-pipe-with-specials
|
(define make-pipe-with-specials
|
||||||
|
@ -891,9 +890,14 @@
|
||||||
n)))))
|
n)))))
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(when close-orig?
|
(when close-orig?
|
||||||
(close-input-port port)))))))
|
(close-input-port port)))
|
||||||
|
(and (port-provides-progress-evts? port)
|
||||||
|
(lambda () (port-progress-evt port)))
|
||||||
|
(and (port-provides-progress-evts? port)
|
||||||
|
(lambda (n evt target-evt) (port-commit-peeked n evt target-evt port)))
|
||||||
|
(lambda () (port-next-location port))
|
||||||
|
(lambda () (port-count-lines! port))
|
||||||
|
(add1 (file-position port))))))
|
||||||
|
|
||||||
(define special-filter-input-port
|
(define special-filter-input-port
|
||||||
(lambda (p filter [close? #t])
|
(lambda (p filter [close? #t])
|
||||||
|
@ -927,8 +931,7 @@
|
||||||
(lambda (n evt target-evt) (port-commit-peeked n evt target-evt p)))
|
(lambda (n evt target-evt) (port-commit-peeked n evt target-evt p)))
|
||||||
(lambda () (port-next-location p))
|
(lambda () (port-next-location p))
|
||||||
(lambda () (port-count-lines! p))
|
(lambda () (port-count-lines! p))
|
||||||
(let-values ([(l c p) (port-next-location p)])
|
(add1 (file-position p)))))
|
||||||
p))))
|
|
||||||
|
|
||||||
;; ----------------------------------------
|
;; ----------------------------------------
|
||||||
|
|
||||||
|
@ -1758,8 +1761,7 @@
|
||||||
(let ([new (transplant-output-port
|
(let ([new (transplant-output-port
|
||||||
p
|
p
|
||||||
(lambda () (port-next-location p))
|
(lambda () (port-next-location p))
|
||||||
(let-values ([(line col pos) (port-next-location p)])
|
(add1 (file-position p))
|
||||||
(or pos (file-position p)))
|
|
||||||
close?
|
close?
|
||||||
(lambda () (port-count-lines! p)))])
|
(lambda () (port-count-lines! p)))])
|
||||||
(port-display-handler new (port-display-handler p))
|
(port-display-handler new (port-display-handler p))
|
||||||
|
@ -1771,8 +1773,7 @@
|
||||||
(let ([new (transplant-input-port
|
(let ([new (transplant-input-port
|
||||||
p
|
p
|
||||||
(lambda () (port-next-location p))
|
(lambda () (port-next-location p))
|
||||||
(let-values ([(line col pos) (port-next-location p)])
|
(add1 (file-position p))
|
||||||
(or pos (file-position p)))
|
|
||||||
close?
|
close?
|
||||||
(lambda () (port-count-lines! p)))])
|
(lambda () (port-count-lines! p)))])
|
||||||
(port-read-handler new (port-read-handler p))
|
(port-read-handler new (port-read-handler p))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user