* mm-util.el (mm-special-display-p): New function.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 31 Oct 2005 06:15:39 +0000 (06:15 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 31 Oct 2005 06:15:39 +0000 (06:15 +0000)
* mml.el (mml-preview): Use it; doc fix.

lisp/ChangeLog
lisp/mm-util.el
lisp/mml.el

index 77e1606..d275ff1 100644 (file)
@@ -1,3 +1,9 @@
+2005-10-31  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mm-util.el (mm-special-display-p): New function.
+
+       * mml.el (mml-preview): Use it; doc fix.
+
 2005-10-29  Romain Francoise  <romain@orebokech.com>
 
        * message.el (message-fix-before-sending): Fix comment.
index 87653b7..161198a 100644 (file)
                               (make-directory file))
                           file)))
      (insert-byte . insert-char)
-     (multibyte-char-to-unibyte . identity))))
+     (multibyte-char-to-unibyte . identity)
+     (special-display-p
+      . (lambda (buffer-name)
+         "Returns non-nil if a buffer named BUFFER-NAME gets a special frame."
+         (and special-display-function
+              (or (and (member buffer-name special-display-buffer-names) t)
+                  (cdr (assoc buffer-name special-display-buffer-names))
+                  (catch 'return
+                    (dolist (elem special-display-regexps)
+                      (and (stringp elem)
+                           (string-match elem buffer-name)
+                           (throw 'return t))
+                      (and (consp elem)
+                           (stringp (car elem))
+                           (string-match (car elem) buffer-name)
+                           (throw 'return (cdr elem))))))))))))
 
 (eval-and-compile
   (defalias 'mm-char-or-char-int-p
index 2b32ac4..db0c20e 100644 (file)
@@ -1213,7 +1213,12 @@ Should be adopted if code in `message-send-mail' is changed."
 
 (defun mml-preview (&optional raw)
   "Display current buffer with Gnus, in a new buffer.
-If RAW, don't highlight the article."
+If RAW, display a raw encoded MIME message.
+
+The window layout for the preview buffer is controled by the variables
+`special-display-buffer-names', `special-display-regexps', or
+`gnus-buffer-configuration' (the first match made will be used),
+or the `pop-to-buffer' function."
   (interactive "P")
   (setq mml-preview-buffer (generate-new-buffer
                            (concat (if raw "*Raw MIME preview of "
@@ -1282,7 +1287,8 @@ If RAW, don't highlight the article."
                       (interactive "@e")
                       (widget-button-press (widget-event-point event) event)))
       (goto-char (point-min))))
-  (if (and (boundp 'gnus-buffer-configuration)
+  (if (and (not (mm-special-display-p (buffer-name mml-preview-buffer)))
+          (boundp 'gnus-buffer-configuration)
           (assq 'mml-preview gnus-buffer-configuration))
       (let ((gnus-message-buffer (current-buffer)))
        (gnus-configure-windows 'mml-preview))