+2011-12-01 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-msg.el (gnus-inews-do-gcc):
+ * message.el (message-send-mail):
+ * mml.el (mml-generate-mime): Share the value of the buffer-local
+ `message-options' variable between a draft buffer and temprary working
+ buffers.
+
2011-11-30 Stefan Monnier <monnier@iro.umontreal.ca>
* message.el (message-pop-to-buffer): Revert 2011-09-11 change.
(message-narrow-to-headers)
(let ((gcc (or gcc (mail-fetch-field "gcc" nil t)))
(cur (current-buffer))
- groups group method group-art
+ groups group method group-art options
mml-externalize-attachments)
(when gcc
(message-remove-header "gcc")
gnus-gcc-externalize-attachments))
(save-excursion
(nnheader-set-temp-buffer " *acc*")
+ (setq message-options (with-current-buffer cur message-options))
(insert-buffer-substring cur)
(message-encode-message-body)
(save-restriction
(boundp 'gnus-inews-mark-gcc-as-read)
(symbol-value 'gnus-inews-mark-gcc-as-read))))
(gnus-group-mark-article-read group (cdr group-art)))
+ (setq options message-options)
+ (with-current-buffer cur (setq message-options options))
(kill-buffer (current-buffer)))))))))
(defun gnus-inews-insert-gcc (&optional group)
(boundp 'gnus-group-posting-charset-alist))
(gnus-setup-posting-charset nil)
message-posting-charset))
- (headers message-required-mail-headers))
+ (headers message-required-mail-headers)
+ options)
(when (and message-generate-hashcash
(not (eq message-generate-hashcash 'opportunistic)))
(message "Generating hashcash...")
(error "Failed to send the message")))))
;; Let the user do all of the above.
(run-hooks 'message-header-hook))
+ (setq options message-options)
(unwind-protect
(with-current-buffer tembuf
(erase-buffer)
+ (setq message-options options)
;; Avoid copying text props (except hard newlines).
(insert (with-current-buffer mailbuf
(mml-buffer-substring-no-properties-except-hard-newlines
(message "Sending via mail...")
(funcall (or message-send-mail-real-function
message-send-mail-function)))
- (message-send-mail-partially)))
+ (message-send-mail-partially))
+ (setq options message-options))
(kill-buffer tembuf))
(set-buffer mailbuf)
+ (setq message-options options)
(push 'mail message-sent-message-via)))
(defvar sendmail-program)
(defun mml-generate-mime ()
"Generate a MIME message based on the current MML document."
(let ((cont (mml-parse))
- (mml-multipart-number mml-multipart-number))
+ (mml-multipart-number mml-multipart-number)
+ (options message-options))
(if (not cont)
nil
- (mm-with-multibyte-buffer
- (if (and (consp (car cont))
- (= (length cont) 1))
- (mml-generate-mime-1 (car cont))
- (mml-generate-mime-1 (nconc (list 'multipart '(type . "mixed"))
- cont)))
- (buffer-string)))))
+ (prog1
+ (mm-with-multibyte-buffer
+ (setq message-options options)
+ (if (and (consp (car cont))
+ (= (length cont) 1))
+ (mml-generate-mime-1 (car cont))
+ (mml-generate-mime-1 (nconc (list 'multipart '(type . "mixed"))
+ cont)))
+ (setq options message-options)
+ (buffer-string))
+ (setq message-options options)))))
(defun mml-generate-mime-1 (cont)
(let ((mm-use-ultra-safe-encoding