From 3d1a901fded41926b9841dd6938d5220cd6162c8 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 14 Jun 2000 02:25:04 +0000 Subject: [PATCH] Implement variable imail-forward-using-mime to allow the user to disable the use of MIME for message forwarding. --- v7/src/imail/imail-top.scm | 35 +++++++++++++++++++++++++---------- v7/src/imail/imail.pkg | 3 ++- v7/src/imail/todo.txt | 4 +--- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/v7/src/imail/imail-top.scm b/v7/src/imail/imail-top.scm index fa026afd9..acfd36d9b 100644 --- a/v7/src/imail/imail-top.scm +++ b/v7/src/imail/imail-top.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-top.scm,v 1.151 2000/06/14 02:15:42 cph Exp $ +;;; $Id: imail-top.scm,v 1.152 2000/06/14 02:24:50 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -143,6 +143,12 @@ Otherwise, the text is left as is." Otherwise, only the header fields normally shown by IMAIL are sent." #f boolean?) + +(define-variable imail-forward-using-mime + "If true, forwarded email messages are sent as MIME attachments. +Otherwise, they are inserted into the message body." + #t + boolean?) (define-command imail "Read and edit incoming mail. @@ -450,6 +456,7 @@ variable's documentation (using \\[describe-variable]) for details: imail-dont-reply-to-names imail-expunge-confirmation imail-forward-all-headers + imail-forward-using-mime imail-ignored-headers imail-kept-headers imail-message-filter @@ -1779,15 +1786,23 @@ see the documentation of `imail-resend'." "]"))) #f (lambda (mail-buffer) - (add-buffer-mime-attachment! - mail-buffer - 'MESSAGE 'RFC822 '() '(INLINE) - (map header-field->mail-header - (let ((headers (message-header-fields message))) - (if (ref-variable imail-forward-all-headers mail-buffer) - headers - (maybe-reformat-headers headers mail-buffer)))) - (message-body message)) + (let ((raw? (ref-variable imail-forward-all-headers mail-buffer))) + (if (ref-variable imail-forward-using-mime mail-buffer) + (add-buffer-mime-attachment! + mail-buffer + 'MESSAGE 'RFC822 '() '(INLINE) + (map header-field->mail-header + (let ((headers (message-header-fields message))) + (if raw? + headers + (maybe-reformat-headers headers mail-buffer)))) + (message-body message)) + (let ((mark (mark-left-inserting-copy (buffer-end mail-buffer)))) + (with-buffer-point-preserved mail-buffer + (lambda () + (insert-header-fields message raw? mark) + (insert-string (message-body message) mark))) + (mark-temporary! mark)))) (if (window-has-no-neighbors? (current-window)) (select-buffer mail-buffer) (select-buffer-other-window mail-buffer)) diff --git a/v7/src/imail/imail.pkg b/v7/src/imail/imail.pkg index 45765eee3..144025cb4 100644 --- a/v7/src/imail/imail.pkg +++ b/v7/src/imail/imail.pkg @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail.pkg,v 1.55 2000/06/12 04:04:46 cph Exp $ +;;; $Id: imail.pkg,v 1.56 2000/06/14 02:24:54 cph Exp $ ;;; ;;; Copyright (c) 2000 Massachusetts Institute of Technology ;;; @@ -255,6 +255,7 @@ edwin-variable$imail-dont-reply-to-names edwin-variable$imail-expunge-confirmation edwin-variable$imail-forward-all-headers + edwin-variable$imail-forward-using-mime edwin-variable$imail-ignored-headers edwin-variable$imail-kept-headers edwin-variable$imail-message-filter diff --git a/v7/src/imail/todo.txt b/v7/src/imail/todo.txt index 09b725c25..4fb8770ad 100644 --- a/v7/src/imail/todo.txt +++ b/v7/src/imail/todo.txt @@ -1,5 +1,5 @@ IMAIL To-Do List -$Id: todo.txt,v 1.78 2000/06/14 02:16:23 cph Exp $ +$Id: todo.txt,v 1.79 2000/06/14 02:25:04 cph Exp $ Bug fixes --------- @@ -25,8 +25,6 @@ New features original message using MIME, rather than the current copy-and-indent mechanism. -* Should MIME encapsulation of forwarded messages be optional? - * Command to expand attachment inline. Sometimes attachments aren't big binary things but small text things that are easier to view inline. -- 2.25.1