;;; -*-Scheme-*-
;;;
-;;; $Id: rmail.scm,v 1.41 1995/05/02 00:40:13 cph Exp $
+;;; $Id: rmail.scm,v 1.42 1995/09/13 04:18:04 cph Exp $
;;;
;;; Copyright (c) 1991-95 Massachusetts Institute of Technology
;;;
(define-variable-local-value! buffer
(ref-variable-object require-final-newline)
false)
+ (define-variable-local-value buffer
+ (ref-variable-object translate-file-data-on-output)
+ #f)
(define-variable-local-value! buffer (ref-variable-object rmail-last-file)
(ref-variable rmail-last-file buffer))
(define-variable-local-value! buffer (ref-variable-object rmail-inbox-list)
(set-buffer-read-only! buffer)
(disable-group-undo! (buffer-group buffer))
(event-distributor/invoke! (ref-variable rmail-mode-hook buffer) buffer)))
-
+\f
(define-major-mode rmail-edit text "RMAIL Edit"
"Major mode for editing the contents of an RMAIL message.
The editing commands are the same as in Text mode,
* \\[rmail-cease-edit] makes them permanent."
(lambda (buffer)
(enable-group-undo! (buffer-group buffer))))
-\f
+
(define (guarantee-variables-initialized)
(if (not (ref-variable rmail-pop-procedure))
(set-variable! rmail-pop-procedure (os/rmail-pop-procedure)))
(string-append "\"" (->namestring pathname)
"\" does not exist, create it")))
(editor-error "Output file does not exist."))
- (call-with-output-file pathname
+ (call-with-binary-output-file pathname
(lambda (port)
(write-string babyl-initial-header port)))))
- (append-to-file region pathname #f)))))
+ (let ((buf (->buffer (region-group region)))
+ (var (ref-variable-object translate-file-data-on-output))
+ (val))
+ (dynamic-wind
+ (lambda ()
+ (set! val
+ (if (variable-local-value? buf var)
+ (variable-local-value buf var)
+ 'NONE))
+ (define-variable-local-value! buf var #f))
+ (lambda ()
+ (append-to-file region pathname #f))
+ (lambda ()
+ (if (eq? val 'NONE)
+ (undefine-variable-local-value! buf var)
+ (define-variable-local-value! buf var val)))))))))
\f
(define-command rmail-output
"Append this message to Unix mail file named FILE-NAME."
(file-time->string (current-file-time))
"\n")
start)))
+ (define-variable-local-value buffer
+ (ref-variable-object translate-file-data-on-output)
+ #f)
(append-to-file (buffer-region buffer) pathname #f)
(kill-buffer buffer)))