From: Katsumi Yamaoka Date: Fri, 22 Oct 2010 04:15:14 +0000 (+0000) Subject: mml.el (mml-preview): Work properly when editing article. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~519 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f9bbc77a409d44044b60ec3990865f7d083c679c;p=emacs.git mml.el (mml-preview): Work properly when editing article. --- 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