changeset 8533:a0af63b5bc45

(rmail-retry-failure): Narrow to just the old header for calling mail-fetch-field. (rmail-maybe-display-summary): Don't set summary window height if its frame isn't split. If summary is in some frame, just use that.
author Richard M. Stallman <rms@gnu.org>
date Sat, 13 Aug 1994 17:36:00 +0000
parents 4f0b260a8dd0
children a446d13c46ea
files lisp/mail/rmail.el
diffstat 1 files changed, 33 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Sat Aug 13 05:26:42 1994 +0000
+++ b/lisp/mail/rmail.el	Sat Aug 13 17:36:00 1994 +0000
@@ -2105,26 +2105,30 @@
 	(or (re-search-forward mail-unsent-separator nil t)
 	    (error "Cannot parse this as a failure message")))
       (save-restriction
-	;; One message contained a few random lines before the old
-	;; message header.  The first line of the message started with
-	;; two hyphens.  A blank line follows these random lines.
-	(skip-chars-forward "\n")
-	(if (looking-at "^--")
-	    (progn
-	      (search-forward "\n\n")
-	      (skip-chars-forward "\n")))
-	(narrow-to-region (point) (point-max))
-	;; Now mail-fetch-field will get from headers of the original message,
-	;; not from the headers of the rejection.
-	(setq to   (mail-fetch-field "To")
-	      subj (mail-fetch-field "Subject")
-	      irp2 (mail-fetch-field "In-reply-to")
-	      cc   (mail-fetch-field "Cc"))
-	;; Get the entire text (not headers) of the original message.
-	(setq orig-message
-	      (buffer-substring
-	       (progn (search-forward "\n\n") (point))
-	       (point-max)))))
+	(let ((old-end (point-max)))
+	  ;; One message contained a few random lines before the old
+	  ;; message header.  The first line of the message started with
+	  ;; two hyphens.  A blank line follows these random lines.
+	  (skip-chars-forward "\n")
+	  (if (looking-at "^--")
+	      (progn
+		(search-forward "\n\n")
+		(skip-chars-forward "\n")))
+	  (narrow-to-region (point) (point-max))
+	  (goto-char (point-min))
+	  (search-forward "\n\n")
+	  (narrow-to-region (point-min) (point))
+	  ;; Now mail-fetch-field will get from headers of the original message,
+	  ;; not from the headers of the rejection.
+	  (setq to   (mail-fetch-field "To")
+		subj (mail-fetch-field "Subject")
+		irp2 (mail-fetch-field "In-reply-to")
+		cc   (mail-fetch-field "Cc"))
+	  ;; Get the entire text (not headers) of the original message.
+	  (goto-char (point-max))
+	  (widen)
+	  (setq orig-message
+		(buffer-substring (point) old-end)))))
     ;; Start sending a new message; default header fields from the original.
     ;; Turn off the usual actions for initializing the message body
     ;; because we want to get only the text from the failure message.
@@ -2176,11 +2180,19 @@
     ;; If requested, make sure the summary is displayed.
     (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
 	 rmail-redisplay-summary
-	 (display-buffer rmail-summary-buffer))
+	 (if (get-buffer-window rmail-summary-buffer 0)
+	     ;; It's already in some frame; show that one.
+	     (let ((frame (window-frame
+			   (get-buffer-window rmail-summary-buffer 0))))
+	       (make-frame-visible frame)
+	       (raise-frame frame))
+	   (display-buffer rmail-summary-buffer)))
     ;; If requested, set the height of the summary window.
     (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
 	 rmail-summary-window-size
 	 (setq window (get-buffer-window rmail-summary-buffer))
+	 ;; Don't try to change the size if just one window in frame.
+	 (not (eq window (frame-root-window (window-frame window))))
 	 (unwind-protect 
 	     (progn
 	       (select-window window)