+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.
(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
(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 "
(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))