(if (or (default-object? permanent)
(not permanent))
output
- permanent))
+ permanent))
(set-string-length! *doc-strings* *doc-string-posn*)
- (call-with-legacy-binary-output-file
- output
- (lambda (port)
- (output-port/write-string port *doc-strings*)))
+ (call-with-binary-output-file output
+ (lambda (port)
+ (write-bytevector (string->bytevector *doc-strings*) port)))
(set! *external-doc-strings?* #f)
(set! *doc-string-posn* 0)
(set! *doc-strings* #f)
(lambda (root-continuation)
(set! editor-thread-root-continuation
root-continuation)
- (with-notification-output-port null-output-port
+ (parameterize* (list (cons notification-output-port
+ null-output-port))
(lambda ()
(do ((thunks (let ((thunks editor-initial-threads))
(set! editor-initial-threads '())
(define-method create-file-folder-file (url (type <rmail-folder-type>))
type
- (call-with-legacy-binary-output-file (pathname-url-pathname url)
+ (call-with-output-file (pathname-url-pathname url)
(lambda (port)
+ (port/set-coding port 'iso-8859-1)
+ (port/set-line-ending port 'newline)
(write-rmail-file-header (make-rmail-folder-header-fields '()) port))))
;;;; Folder
;;;; Write RMAIL file
(define-method write-file-folder ((folder <rmail-folder>) pathname)
- (call-with-legacy-binary-output-file pathname
+ (call-with-output-file pathname
(lambda (port)
+ (port/set-coding port 'iso-8859-1)
+ (port/set-line-ending port 'newline)
(write-rmail-file-header (rmail-folder-header-fields folder) port)
(for-each-vector-element (file-folder-messages folder)
(lambda (message)
(define-method append-message-to-file (message url (type <rmail-folder-type>))
type
- (call-with-legacy-binary-append-file (pathname-url-pathname url)
+ (call-with-append-file (pathname-url-pathname url)
(lambda (port)
+ (port/set-coding port 'iso-8859-1)
+ (port/set-line-ending port 'newline)
(write-rmail-message message port))))
(define (write-rmail-file-header header-fields port)
(eq? type 'MESSAGE)))))
(if (or (not (file-exists? filename))
(prompt-for-yes-or-no? "File already exists; overwrite"))
- ((if text? call-with-output-file call-with-legacy-binary-output-file)
- filename
- (lambda (port)
- (call-with-mime-decoding-output-port
- (let ((encoding (mime-body-one-part-encoding body)))
- (if (and (mime-type? body 'APPLICATION 'MAC-BINHEX40)
- (eq? encoding '7BIT))
- 'BINHEX40
- encoding))
- port
- text?
- (lambda (port)
- (with-mime-best-effort
- (lambda ()
- (write-mime-body body port)))))))))))
+ (call-with-output-file filename
+ (lambda (port)
+ (if (not text?)
+ (begin
+ (port/set-coding port 'binary)
+ (port/set-line-ending port 'binary)))
+ (call-with-mime-decoding-output-port
+ (let ((encoding (mime-body-one-part-encoding body)))
+ (if (and (mime-type? body 'APPLICATION 'MAC-BINHEX40)
+ (eq? encoding '7BIT))
+ 'BINHEX40
+ encoding))
+ port
+ text?
+ (lambda (port)
+ (with-mime-best-effort
+ (lambda ()
+ (write-mime-body body port)))))))))))
(define (filter-mime-attachment-filename filename)
(let ((filename
(define-method create-file-folder-file (url (type <umail-folder-type>))
type
- (call-with-legacy-binary-output-file (pathname-url-pathname url)
+ (call-with-output-file (pathname-url-pathname url)
(lambda (port)
port
unspecific)))
;;;; Write unix mail file
(define-method write-file-folder ((folder <umail-folder>) pathname)
- (call-with-legacy-binary-output-file pathname
+ (call-with-output-file pathname
(lambda (port)
+ (port/set-coding port 'iso-8859-1)
+ (port/set-line-ending port 'newline)
(for-each-vector-element (file-folder-messages folder)
(lambda (message)
(write-umail-message message #t port)))
(define-method append-message-to-file (message url (type <umail-folder-type>))
type
- (call-with-legacy-binary-append-file (pathname-url-pathname url)
+ (call-with-append-file (pathname-url-pathname url)
(lambda (port)
+ (port/set-coding port 'iso-8859-1)
+ (port/set-line-ending port 'newline)
(write-umail-message message #t port))))
(define (write-umail-message message output-flags? port)
;;;; Extended-string input port
(define (read-file-into-string pathname)
- (call-with-legacy-binary-input-file pathname
+ (call-with-input-file pathname
(lambda (port)
+ (port/set-coding port 'iso-8859-1)
+ (port/set-line-ending port 'newline)
(let ((n-bytes ((textual-port-operation port 'LENGTH) port)))
(let ((string (make-string n-bytes)))
(let loop ((start 0))