From f9bbc77a409d44044b60ec3990865f7d083c679c Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Fri, 22 Oct 2010 04:15:14 +0000 Subject: [PATCH] mml.el (mml-preview): Work properly when editing article. --- lisp/gnus/ChangeLog | 2 ++ lisp/gnus/mml.el | 18 ++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index e6decde4b6f..7c3b91cbea7 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,5 +1,7 @@ 2010-10-22 Katsumi Yamaoka + * mml.el (mml-preview): Work properly when editing article. + * gnus-start.el (gnus-read-active-file-1): Don't add method to gnus-have-read-active-file if it's already been in. diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index 1975af4183a..0ef64f2746f 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -1466,6 +1466,7 @@ or the `pop-to-buffer' function." (require 'gnus-msg) ; for gnus-setup-posting-charset (save-excursion (let* ((buf (current-buffer)) + (article-editing (eq major-mode 'gnus-article-edit-mode)) (message-options message-options) (message-this-is-mail (message-mail-p)) (message-this-is-news (message-news-p)) @@ -1485,15 +1486,20 @@ or the `pop-to-buffer' function." (mml-preview-insert-mail-followup-to) (let ((message-deletable-headers (if (message-news-p) nil - message-deletable-headers))) + message-deletable-headers)) + (mail-header-separator (if article-editing + "" + mail-header-separator))) (message-generate-headers (copy-sequence (if (message-news-p) message-required-news-headers - message-required-mail-headers)))) - (if (re-search-forward - (concat "^" (regexp-quote mail-header-separator) "\n") nil t) - (replace-match "\n")) - (let ((mail-header-separator ""));; mail-header-separator is removed. + message-required-mail-headers))) + (if (and (not article-editing) + (re-search-forward + (concat "^" (regexp-quote mail-header-separator) "\n") + nil t)) + (replace-match "\n")) + (setq mail-header-separator "") (message-sort-headers) (mml-to-mime)) (if raw -- 2.39.5