Eliminate more low-hanging deprecations.
authorChris Hanson <org/chris-hanson/cph>
Wed, 26 Apr 2017 05:49:26 +0000 (22:49 -0700)
committerChris Hanson <org/chris-hanson/cph>
Wed, 26 Apr 2017 05:49:26 +0000 (22:49 -0700)
src/edwin/docstr.scm
src/edwin/editor.scm
src/imail/imail-rmail.scm
src/imail/imail-top.scm
src/imail/imail-umail.scm
src/imail/imail-util.scm

index 3731297cbb0c12c238bb99fc5ee23c06be64a4b6..b812855b1253478caef1fdc4be8e424f1db57d5b 100644 (file)
@@ -141,12 +141,11 @@ USA.
        (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)
index e74655e9c87f0fd6b84b4412f1e63267b633d7aa..2f9deb0d5514e26721235f69b68380317d6c1767 100644 (file)
@@ -70,7 +70,8 @@ USA.
                      (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 '())
index 9b62e424a4cefa404ba3a7a49c8ab59b3a7260a4..dc185964898064ba2bf9caa26832539321678d8b 100644 (file)
@@ -38,8 +38,10 @@ USA.
 
 (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
@@ -233,8 +235,10 @@ USA.
 ;;;; 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)
@@ -243,8 +247,10 @@ USA.
 
 (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)
index 1093eb865e0b34e885afc6fca88905f5f859123e..739cc16328d4edcf37f2c35d54a78a188b2cda39 100644 (file)
@@ -1097,21 +1097,24 @@ With prefix argument, prompt even when point is on an attachment."
                 (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
index 3f4280476c9f6c6f74f6afbdcf492d9c78ae7791..0b0e696797167dc081230bc121fc8c7ecc505b03 100644 (file)
@@ -38,7 +38,7 @@ USA.
 
 (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)))
@@ -144,8 +144,10 @@ USA.
 ;;;; 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)))
@@ -153,8 +155,10 @@ USA.
 
 (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)
index 8dce7d435e94b0c02437e0185301b895d7ea65b0..f013ed1bbbc8f937200198adaedc047e8021a91c 100644 (file)
@@ -423,8 +423,10 @@ USA.
 ;;;; 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))