* gnus-win.el (gnus-buffer-configuration): Add mml-preview.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 22 Sep 2004 13:07:29 +0000 (13:07 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Wed, 22 Sep 2004 13:07:29 +0000 (13:07 +0000)
(gnus-window-to-buffer): Ditto.

* mml.el (mml-preview-buffer): New variable.
(mml-preview): Manage window layout with gnus-buffer-configuration.

lisp/ChangeLog
lisp/gnus-win.el
lisp/mml.el

index 59a0b70..fa5897f 100644 (file)
@@ -1,5 +1,11 @@
 2004-09-22  Katsumi Yamaoka  <yamaoka@jpl.org>
 
+       * gnus-win.el (gnus-buffer-configuration): Add mml-preview.
+       (gnus-window-to-buffer): Ditto.
+
+       * mml.el (mml-preview-buffer): New variable.
+       (mml-preview): Manage window layout with gnus-buffer-configuration.
+
        * gnus-msg.el (gnus-setup-message): Put article numbers into the
        X-Draft-From header even if those articles aren't quoted.
 
index 8de4673..1db5dc3 100644 (file)
@@ -1,5 +1,5 @@
 ;;; gnus-win.el --- window configuration functions for Gnus
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -164,8 +164,12 @@ used to display Gnus windows."
               (article 0.5)
               (message 1.0 point)))
     (display-term
-      (vertical 1.0
-               ("*display*" 1.0))))
+     (vertical 1.0
+              ("*display*" 1.0)))
+    (mml-preview
+     (vertical 1.0
+              (message 0.5)
+              (mml-preview 1.0 point))))
   "Window configuration for all possible Gnus buffers.
 See the Gnus manual for an explanation of the syntax used.")
 
@@ -193,7 +197,8 @@ See the Gnus manual for an explanation of the syntax used.")
     (info . gnus-info-buffer)
     (category . gnus-category-buffer)
     (article-copy . gnus-article-copy)
-    (draft . gnus-draft-buffer))
+    (draft . gnus-draft-buffer)
+    (mml-preview . mml-preview-buffer))
   "Mapping from short symbols to buffer names or buffer variables.")
 
 (defcustom gnus-configure-windows-hook nil
index 35b9d60..499e00d 100644 (file)
@@ -1,5 +1,5 @@
 ;;; mml.el --- A package for parsing and validating MML documents
-;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
+;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
@@ -1078,10 +1078,15 @@ Should be adopted if code in `message-send-mail' is changed."
     (message-position-on-field "Mail-Followup-To" "X-Draft-From")
     (insert (message-make-mail-followup-to))))
 
+(defvar mml-preview-buffer nil)
+
 (defun mml-preview (&optional raw)
   "Display current buffer with Gnus, in a new buffer.
 If RAW, don't highlight the article."
   (interactive "P")
+  (setq mml-preview-buffer (generate-new-buffer
+                           (concat (if raw "*Raw MIME preview of "
+                                     "*MIME preview of ") (buffer-name))))
   (save-excursion
     (let* ((buf (current-buffer))
           (message-options message-options)
@@ -1093,11 +1098,9 @@ If RAW, don't highlight the article."
                                           (message-fetch-field "Newsgroups")))
                                        message-posting-charset)))
       (message-options-set-recipient)
-      (pop-to-buffer (generate-new-buffer
-                     (concat (if raw "*Raw MIME preview of "
-                               "*MIME preview of ") (buffer-name))))
       (when (boundp 'gnus-buffers)
-       (push (current-buffer) gnus-buffers))
+       (push mml-preview-buffer gnus-buffers))
+      (set-buffer mml-preview-buffer)
       (erase-buffer)
       (insert-buffer-substring buf)
       (mml-preview-insert-mail-followup-to)
@@ -1144,7 +1147,11 @@ If RAW, don't highlight the article."
                     (lambda (event)
                       (interactive "@e")
                       (widget-button-press (widget-event-point event) event)))
-      (goto-char (point-min)))))
+      (goto-char (point-min))))
+  (if (and (boundp 'gnus-buffer-configuration)
+          (assq 'mml-preview gnus-buffer-configuration))
+      (gnus-configure-windows 'mml-preview)
+    (pop-to-buffer mml-preview-buffer)))
 
 (defun mml-validate ()
   "Validate the current MML document."