changeset 16633:bd4dbc8ca6f7

(rmail-start-mail): Rewrite to use compose-mail. Two new arguments. (rmail-forward): Always call rmail-start-mail, never `mail'.
author Richard M. Stallman <rms@gnu.org>
date Sat, 07 Dec 1996 22:13:48 +0000
parents 5dd86f31843a
children a076177cfac7
files lisp/mail/rmail.el
diffstat 1 files changed, 39 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Sat Dec 07 21:30:17 1996 +0000
+++ b/lisp/mail/rmail.el	Sat Dec 07 22:13:48 1996 +0000
@@ -2156,15 +2156,29 @@
 
 ;;;; *** Rmail Mailing Commands ***
 
-(defun rmail-start-mail (&rest args)
-  (if (and window-system rmail-mail-new-frame)
-      (prog1
-	(apply 'mail-other-frame args)
-	;; This is not a standard frame parameter;
-	;; nothing except sendmail.el looks at it.
-	(modify-frame-parameters (selected-frame)
-				 '((mail-dedicated-frame . t))))
-    (apply 'mail-other-window args)))
+(defun rmail-start-mail (&optional noerase to subject in-reply-to cc
+				   replybuffer sendactions same-window others)
+  (let (yank-action)
+    (if replybuffer
+	(setq yank-action (list 'insert-buffer replybuffer)))
+    (setq others (cons (cons "cc" cc) others))
+    (setq others (cons (cons "in-reply-to" in-reply-to) others))
+    (if same-window
+	(compose-mail to subject others
+		      noerase nil
+		      yank-action sendactions)
+      (if (and window-system rmail-mail-new-frame)
+	  (prog1
+	      (compose-mail to subject others
+			    noerase 'switch-to-buffer-other-frame
+			    yank-action sendactions)
+	    ;; This is not a standard frame parameter;
+	    ;; nothing except sendmail.el looks at it.
+	    (modify-frame-parameters (selected-frame)
+				     '((mail-dedicated-frame . t))))
+	(compose-mail to subject others
+		      noerase 'switch-to-buffer-other-window
+		      yank-action sendactions)))))
 
 (defun rmail-mail ()
   "Send mail in another window.
@@ -2338,23 +2352,22 @@
 			       ""))
 			   (or (mail-fetch-field "Subject") "")
 			   "]")))
-      ;; If only one window, use it for the mail buffer.
-      ;; Otherwise, use another window for the mail buffer
-      ;; so that the Rmail buffer remains visible
-      ;; and sending the mail will get back to it.
-      (if (funcall (if (and (not rmail-mail-new-frame) (one-window-p t))
-		       (function mail)
-		     (function rmail-start-mail))
-		   nil nil subject nil nil nil
-		   (list (list (function
-				(lambda ()
-				  (let ((msgnum
-					 rmail-send-actions-rmail-msg-number))
-				    (save-excursion
-				      (set-buffer rmail-send-actions-rmail-buffer)
-				      (if msgnum
-					  (rmail-set-attribute
-					   "forwarded" t msgnum)))))))))
+      (if (rmail-start-mail
+	   nil nil subject nil nil nil
+	   (list (list (function
+			(lambda ()
+			  (let ((msgnum
+				 rmail-send-actions-rmail-msg-number))
+			    (save-excursion
+			      (set-buffer rmail-send-actions-rmail-buffer)
+			      (if msgnum
+				  (rmail-set-attribute
+				   "forwarded" t msgnum))))))))
+	   ;; If only one window, use it for the mail buffer.
+	   ;; Otherwise, use another window for the mail buffer
+	   ;; so that the Rmail buffer remains visible
+	   ;; and sending the mail will get back to it.
+	   (and (not rmail-mail-new-frame) (one-window-p t)))
 	  ;; The mail buffer is now current.
 	  (save-excursion
 	    ;; We keep the rmail buffer and message number in these