summaryrefslogtreecommitdiff
path: root/lisp/mail
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2005-09-12 21:58:21 +0000
committerChong Yidong <cyd@stupidchicken.com>2005-09-12 21:58:21 +0000
commit1db2d450cbf0bfcb78edd5670a5d902c043edef2 (patch)
tree35ed47bf2c41f99cd9ebff1c52912e9ad2d1b6e5 /lisp/mail
parent34cb01154aaa2b5a9803a56941f1074db326924c (diff)
downloademacs-1db2d450cbf0bfcb78edd5670a5d902c043edef2.tar.gz
2005-09-13 Chong Yidong <cyd@stupidchicken.com>
* mail/sendmail.el (mail): Use new buffer if `noerase' argument is `new'.
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/sendmail.el18
1 files changed, 14 insertions, 4 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index f5c34ff80ca..32328a33177 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -1591,8 +1591,13 @@ is inserted.
The normal hook `mail-setup-hook' is run after the message is
initialized. It can add more default fields to the message.
-When calling from a program, the first argument if non-nil says
-not to erase the existing contents of the `*mail*' buffer.
+The first argument, NOERASE, determines what to do when there is
+an existing modified `*mail*' buffer. If NOERASE is nil, the
+existing mail buffer is used, and the user is prompted whether to
+keep the old contents or to erase them. If NOERASE has the value
+`new', a new mail buffer will be created instead of using the old
+one. Any other non-nil value means to always select the old
+buffer without erasing the contents.
The second through fifth arguments,
TO, SUBJECT, IN-REPLY-TO and CC, specify if non-nil
@@ -1649,7 +1654,11 @@ The seventh argument ACTIONS is a list of actions to take
;;; (file-exists-p buffer-auto-save-file-name))
;;; (message "Auto save file for draft message exists; consider M-x mail-recover"))
;;; t))
- (pop-to-buffer "*mail*")
+
+ (if (eq noerase 'new)
+ (pop-to-buffer (generate-new-buffer "*mail*"))
+ (pop-to-buffer "*mail*"))
+
;; Avoid danger that the auto-save file can't be written.
(let ((dir (expand-file-name
(file-name-as-directory mail-default-directory))))
@@ -1664,7 +1673,8 @@ The seventh argument ACTIONS is a list of actions to take
;; (in case the user has actually visited a file *mail*).
; (set-visited-file-name nil)
(let (initialized)
- (and (not noerase)
+ (and (or (not noerase)
+ (eq noerase 'new))
(if buffer-file-name
(if (buffer-modified-p)
(when (y-or-n-p "Buffer has unsaved changes; reinitialize it and discard them? ")