aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-12-07 22:13:48 +0000
committerRichard M. Stallman1996-12-07 22:13:48 +0000
commitbde7cb3faec9862664f16f642d67cb7cc40e4bcb (patch)
treed6acfea93e1636c62752c480a55f000d6617cacb
parentd0008a00b2167174792b57052fbbc42fda8c3300 (diff)
downloademacs-bde7cb3faec9862664f16f642d67cb7cc40e4bcb.tar.gz
emacs-bde7cb3faec9862664f16f642d67cb7cc40e4bcb.zip
(rmail-start-mail): Rewrite to use compose-mail.
Two new arguments. (rmail-forward): Always call rmail-start-mail, never `mail'.
-rw-r--r--lisp/mail/rmail.el65
1 files changed, 39 insertions, 26 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 2b5caaf3e7e..d882d24c330 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -2156,15 +2156,29 @@ Deleted messages stay in the file until the \\[rmail-expunge] command is given."
2156 2156
2157;;;; *** Rmail Mailing Commands *** 2157;;;; *** Rmail Mailing Commands ***
2158 2158
2159(defun rmail-start-mail (&rest args) 2159(defun rmail-start-mail (&optional noerase to subject in-reply-to cc
2160 (if (and window-system rmail-mail-new-frame) 2160 replybuffer sendactions same-window others)
2161 (prog1 2161 (let (yank-action)
2162 (apply 'mail-other-frame args) 2162 (if replybuffer
2163 ;; This is not a standard frame parameter; 2163 (setq yank-action (list 'insert-buffer replybuffer)))
2164 ;; nothing except sendmail.el looks at it. 2164 (setq others (cons (cons "cc" cc) others))
2165 (modify-frame-parameters (selected-frame) 2165 (setq others (cons (cons "in-reply-to" in-reply-to) others))
2166 '((mail-dedicated-frame . t)))) 2166 (if same-window
2167 (apply 'mail-other-window args))) 2167 (compose-mail to subject others
2168 noerase nil
2169 yank-action sendactions)
2170 (if (and window-system rmail-mail-new-frame)
2171 (prog1
2172 (compose-mail to subject others
2173 noerase 'switch-to-buffer-other-frame
2174 yank-action sendactions)
2175 ;; This is not a standard frame parameter;
2176 ;; nothing except sendmail.el looks at it.
2177 (modify-frame-parameters (selected-frame)
2178 '((mail-dedicated-frame . t))))
2179 (compose-mail to subject others
2180 noerase 'switch-to-buffer-other-window
2181 yank-action sendactions)))))
2168 2182
2169(defun rmail-mail () 2183(defun rmail-mail ()
2170 "Send mail in another window. 2184 "Send mail in another window.
@@ -2338,23 +2352,22 @@ see the documentation of `rmail-resend'."
2338 "")) 2352 ""))
2339 (or (mail-fetch-field "Subject") "") 2353 (or (mail-fetch-field "Subject") "")
2340 "]"))) 2354 "]")))
2341 ;; If only one window, use it for the mail buffer. 2355 (if (rmail-start-mail
2342 ;; Otherwise, use another window for the mail buffer 2356 nil nil subject nil nil nil
2343 ;; so that the Rmail buffer remains visible 2357 (list (list (function
2344 ;; and sending the mail will get back to it. 2358 (lambda ()
2345 (if (funcall (if (and (not rmail-mail-new-frame) (one-window-p t)) 2359 (let ((msgnum
2346 (function mail) 2360 rmail-send-actions-rmail-msg-number))
2347 (function rmail-start-mail)) 2361 (save-excursion
2348 nil nil subject nil nil nil 2362 (set-buffer rmail-send-actions-rmail-buffer)
2349 (list (list (function 2363 (if msgnum
2350 (lambda () 2364 (rmail-set-attribute
2351 (let ((msgnum 2365 "forwarded" t msgnum))))))))
2352 rmail-send-actions-rmail-msg-number)) 2366 ;; If only one window, use it for the mail buffer.
2353 (save-excursion 2367 ;; Otherwise, use another window for the mail buffer
2354 (set-buffer rmail-send-actions-rmail-buffer) 2368 ;; so that the Rmail buffer remains visible
2355 (if msgnum 2369 ;; and sending the mail will get back to it.
2356 (rmail-set-attribute 2370 (and (not rmail-mail-new-frame) (one-window-p t)))
2357 "forwarded" t msgnum)))))))))
2358 ;; The mail buffer is now current. 2371 ;; The mail buffer is now current.
2359 (save-excursion 2372 (save-excursion
2360 ;; We keep the rmail buffer and message number in these 2373 ;; We keep the rmail buffer and message number in these