aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2011-09-09 11:59:51 +0300
committerEli Zaretskii2011-09-09 11:59:51 +0300
commit14a29deb45df18c2e6e62cc1dfefcd63d46f168b (patch)
treebac14bad824f349f2030ad42586703c53479543e
parent208a048da7706662bcb55579063a63cc95a524c9 (diff)
parentfd59d131bb4fe60fe008156795c243ec6e1127b0 (diff)
downloademacs-14a29deb45df18c2e6e62cc1dfefcd63d46f168b.tar.gz
emacs-14a29deb45df18c2e6e62cc1dfefcd63d46f168b.zip
Fix bug #9392 with rmail-forward.
lisp/simple.el (mail-encode-mml): New defvar. lisp/mail/rmail.el (mail-encode-mml): Add a defvar. (rmail-enable-mime-composing): Default to t. (rmail-forward): Use MIME method of forwarding only if both rmail-enable-mime-composing and rmail-enable-mime are non-nil. Set mail-encode-mml non-nil if the MIME method was used. lisp/mail/sendmail.el (mml-to-mime): Add autoload form. (mail-encode-mml): Add a defvar. (mail-mode): Make mail-encode-mml buffer-local and initialize it to nil. (mail-send): If mail-encode-mml is non-nil, run the outgoing message through mml-to-mime, and reset mail-encode-mml to nil.
-rw-r--r--lisp/ChangeLog18
-rw-r--r--lisp/mail/rmail.el17
-rw-r--r--lisp/mail/sendmail.el9
-rw-r--r--lisp/simple.el5
4 files changed, 45 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7806877c6f5..04bc29bf1b0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,21 @@
12011-09-09 Eli Zaretskii <eliz@gnu.org>
2
3 Fix for Savannah bug#9392.
4 * simple.el (mail-encode-mml): New defvar.
5
6 * mail/rmail.el (mail-encode-mml): Add a defvar.
7 (rmail-enable-mime-composing): Default to t.
8 (rmail-forward): Use MIME method of forwarding only if both
9 rmail-enable-mime-composing and rmail-enable-mime are non-nil.
10 Set mail-encode-mml non-nil if the MIME method was used.
11
12 * mail/sendmail.el (mml-to-mime): Add autoload form.
13 (mail-encode-mml): Add a defvar.
14 (mail-mode): Make mail-encode-mml buffer-local and initialize it
15 to nil.
16 (mail-send): If mail-encode-mml is non-nil, run the outgoing
17 message through mml-to-mime, and reset mail-encode-mml to nil.
18
12011-09-09 Glenn Morris <rgm@gnu.org> 192011-09-09 Glenn Morris <rgm@gnu.org>
2 20
3 * woman.el (woman-if-body): When processing an .el block, 21 * woman.el (woman-if-body): When processing an .el block,
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index ac07f07a76b..db06de9be76 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -91,6 +91,7 @@ its character representation and its display representation.")
91(defvar messages-head) 91(defvar messages-head)
92(defvar total-messages) 92(defvar total-messages)
93(defvar tool-bar-map) 93(defvar tool-bar-map)
94(defvar mail-encode-mml)
94 95
95(defvar rmail-header-style 'normal 96(defvar rmail-header-style 'normal
96 "The current header display style choice, one of 97 "The current header display style choice, one of
@@ -642,7 +643,7 @@ unless the feature specified by `rmail-mime-feature' is available."
642 :version "23.3" 643 :version "23.3"
643 :group 'rmail) 644 :group 'rmail)
644 645
645(defvar rmail-enable-mime-composing nil 646(defvar rmail-enable-mime-composing t
646 "*If non-nil, RMAIL uses `rmail-insert-mime-forwarded-message-function' to forward.") 647 "*If non-nil, RMAIL uses `rmail-insert-mime-forwarded-message-function' to forward.")
647 648
648;; FIXME unused. 649;; FIXME unused.
@@ -3794,9 +3795,17 @@ see the documentation of `rmail-resend'."
3794 ;; Insert after header separator--before signature if any. 3795 ;; Insert after header separator--before signature if any.
3795 (rfc822-goto-eoh) 3796 (rfc822-goto-eoh)
3796 (forward-line 1) 3797 (forward-line 1)
3797 (if (or rmail-enable-mime rmail-enable-mime-composing) 3798 (if (and rmail-enable-mime rmail-enable-mime-composing)
3798 (funcall rmail-insert-mime-forwarded-message-function 3799 (prog1
3799 forward-buffer) 3800 (funcall rmail-insert-mime-forwarded-message-function
3801 forward-buffer)
3802 ;; rmail-insert-mime-forwarded-message-function
3803 ;; works by inserting MML tags into forward-buffer.
3804 ;; The MUA will need to convert it to MIME before
3805 ;; sending. mail-encode-mml tells them to do that.
3806 ;; message.el does that automagically.
3807 (or (eq mail-user-agent 'message-user-agent)
3808 (setq mail-encode-mml t)))
3800 (insert "------- Start of forwarded message -------\n") 3809 (insert "------- Start of forwarded message -------\n")
3801 ;; Quote lines with `- ' if they start with `-'. 3810 ;; Quote lines with `- ' if they start with `-'.
3802 (let ((beg (point)) end) 3811 (let ((beg (point)) end)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index cb02a4b374d..f7dc01e8ebf 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -31,6 +31,9 @@
31 31
32(require 'rfc2047) 32(require 'rfc2047)
33 33
34(autoload 'mml-to-mime "mml"
35 "Translate the current buffer from MML to MIME.")
36
34(defgroup sendmail nil 37(defgroup sendmail nil
35 "Mail sending commands for Emacs." 38 "Mail sending commands for Emacs."
36 :prefix "mail-" 39 :prefix "mail-"
@@ -678,6 +681,7 @@ switching to, the `*mail*' buffer. See also `mail-setup-hook'."
678 :options '(footnote-mode)) 681 :options '(footnote-mode))
679 682
680(defvar mail-mode-abbrev-table text-mode-abbrev-table) 683(defvar mail-mode-abbrev-table text-mode-abbrev-table)
684(defvar mail-encode-mml)
681;;;###autoload 685;;;###autoload
682(define-derived-mode mail-mode text-mode "Mail" 686(define-derived-mode mail-mode text-mode "Mail"
683 "Major mode for editing mail to be sent. 687 "Major mode for editing mail to be sent.
@@ -701,6 +705,8 @@ Turning on Mail mode runs the normal hooks `text-mode-hook' and
701 (make-local-variable 'mail-reply-action) 705 (make-local-variable 'mail-reply-action)
702 (make-local-variable 'mail-send-actions) 706 (make-local-variable 'mail-send-actions)
703 (make-local-variable 'mail-return-action) 707 (make-local-variable 'mail-return-action)
708 (make-local-variable 'mail-encode-mml)
709 (setq mail-encode-mml nil)
704 (setq buffer-offer-save t) 710 (setq buffer-offer-save t)
705 (make-local-variable 'font-lock-defaults) 711 (make-local-variable 'font-lock-defaults)
706 (setq font-lock-defaults '(mail-font-lock-keywords t t)) 712 (setq font-lock-defaults '(mail-font-lock-keywords t t))
@@ -934,6 +940,9 @@ the user from the mailer."
934 (error "Invalid header line (maybe a continuation line lacks initial whitespace)")) 940 (error "Invalid header line (maybe a continuation line lacks initial whitespace)"))
935 (forward-line 1))) 941 (forward-line 1)))
936 (goto-char opoint) 942 (goto-char opoint)
943 (when mail-encode-mml
944 (mml-to-mime)
945 (setq mail-encode-mml nil))
937 (run-hooks 'mail-send-hook) 946 (run-hooks 'mail-send-hook)
938 (message "Sending...") 947 (message "Sending...")
939 (funcall send-mail-function) 948 (funcall send-mail-function)
diff --git a/lisp/simple.el b/lisp/simple.el
index 2d4f883f1ed..5b639f774cb 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5729,6 +5729,11 @@ else the end of the last line. This function obeys RFC822."
5729 "^\\([:\n]\\|[^: \t\n]+[ \t\n]\\)" nil 'move) 5729 "^\\([:\n]\\|[^: \t\n]+[ \t\n]\\)" nil 'move)
5730 (goto-char (match-beginning 0)))) 5730 (goto-char (match-beginning 0))))
5731 5731
5732;; Used by Rmail (e.g., rmail-forward).
5733(defvar mail-encode-mml nil
5734 "If non-nil, mail-user-agent's `sendfunc' command should mml-encode
5735the outgoing message before sending it.")
5736
5732(defun compose-mail (&optional to subject other-headers continue 5737(defun compose-mail (&optional to subject other-headers continue
5733 switch-function yank-action send-actions 5738 switch-function yank-action send-actions
5734 return-action) 5739 return-action)