Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-buffer-configuration in mml-preview
@ 2005-10-28 12:26 Reiner Steib
  2005-10-28 15:09 ` Katsumi Yamaoka
  0 siblings, 1 reply; 3+ messages in thread
From: Reiner Steib @ 2005-10-28 12:26 UTC (permalink / raw)


Hi,

the changes in `mml-preview' in the trunk (compared to v5-10 or
revision 7.17 [1]) prevent that my configuration of
`special-display-regexps'[1] does the right thing.

I can work around this by removing mml-preview from
gnus-buffer-configuration:

(when (assq 'mml-preview gnus-buffer-configuration)
  (setq gnus-buffer-configuration
	(remove (assq 'mml-preview gnus-buffer-configuration)
		gnus-buffer-configuration)))

I'm not sure if `gnus-buffer-configuration' is supposed to override
`special-display-regexps' or not.  I don't say that the code in
`mml-preview' is incorrect, but maybe we should document it.

Bye, Reiner.

[1]
,----[ <f1> v special-display-regexps RET ]
| special-display-regexps is a variable defined in `C source code'.
| Its value is shown below.
| 
| Documentation:
| *List of regexps saying which buffers should have their own special frames.
| [...]
| Value:
| ([...] ("MIME preview" (height . 55)) [...])
`----

[2]
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.

--8<---------------cut here---------------start------------->8---
--- mml.el	28 Oct 2005 14:20:41 +0200	7.17
+++ mml.el	28 Oct 2005 14:12:52 +0200	
@@ -1078,10 +1209,15 @@
     (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,13 +1229,13 @@
 					   (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))
-      (erase-buffer)
-      (insert-buffer-substring buf)
+	(push mml-preview-buffer gnus-buffers))
+      (save-restriction
+	(widen)
+	(set-buffer mml-preview-buffer)
+	(erase-buffer)
+	(insert-buffer-substring buf))
       (mml-preview-insert-mail-followup-to)
       (let ((message-deletable-headers (if (message-news-p)
 					   nil
@@ -1112,6 +1248,7 @@
 	   (concat "^" (regexp-quote mail-header-separator) "\n") nil t)
 	  (replace-match "\n"))
       (let ((mail-header-separator ""));; mail-header-separator is removed.
+	(message-sort-headers)
 	(mml-to-mime))
       (if raw
 	  (when (fboundp 'set-buffer-multibyte)
@@ -1144,7 +1281,12 @@
 		     (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))
+      (let ((gnus-message-buffer (current-buffer)))
+	(gnus-configure-windows 'mml-preview))
+    (pop-to-buffer mml-preview-buffer)))
 
 (defun mml-validate ()
   "Validate the current MML document."
--8<---------------cut here---------------end--------------->8---
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-10-31  6:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-28 12:26 gnus-buffer-configuration in mml-preview Reiner Steib
2005-10-28 15:09 ` Katsumi Yamaoka
2005-10-31  6:16   ` Katsumi Yamaoka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).