1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-04 11:40:22 +00:00

(rmail-start-mail): Rewrite to use compose-mail.

Two new arguments.
(rmail-forward): Always call rmail-start-mail, never `mail'.
This commit is contained in:
Richard M. Stallman 1996-12-07 22:13:48 +00:00
parent d0008a00b2
commit bde7cb3fae

View File

@ -2156,15 +2156,29 @@ Deleted messages stay in the file until the \\[rmail-expunge] command is given."
;;;; *** 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 @@ see the documentation of `rmail-resend'."
""))
(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