aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2005-09-12 21:58:21 +0000
committerChong Yidong2005-09-12 21:58:21 +0000
commit1db2d450cbf0bfcb78edd5670a5d902c043edef2 (patch)
tree35ed47bf2c41f99cd9ebff1c52912e9ad2d1b6e5
parent34cb01154aaa2b5a9803a56941f1074db326924c (diff)
downloademacs-1db2d450cbf0bfcb78edd5670a5d902c043edef2.tar.gz
emacs-1db2d450cbf0bfcb78edd5670a5d902c043edef2.zip
2005-09-13 Chong Yidong <cyd@stupidchicken.com>
* mail/sendmail.el (mail): Use new buffer if `noerase' argument is `new'.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/mail/sendmail.el18
2 files changed, 19 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ea8039d7c2f..f9abe4ca871 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12005-09-13 Chong Yidong <cyd@stupidchicken.com>
2
3 * mail/sendmail.el (mail): Use new buffer if `noerase' argument is
4 `new'.
5
12005-09-12 Richard M. Stallman <rms@gnu.org> 62005-09-12 Richard M. Stallman <rms@gnu.org>
2 7
3 * font-lock.el (font-lock-keywords): Add autoload. 8 * font-lock.el (font-lock-keywords): Add autoload.
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.
1591The normal hook `mail-setup-hook' is run after the message is 1591The normal hook `mail-setup-hook' is run after the message is
1592initialized. It can add more default fields to the message. 1592initialized. It can add more default fields to the message.
1593 1593
1594When calling from a program, the first argument if non-nil says 1594The first argument, NOERASE, determines what to do when there is
1595not to erase the existing contents of the `*mail*' buffer. 1595an existing modified `*mail*' buffer. If NOERASE is nil, the
1596existing mail buffer is used, and the user is prompted whether to
1597keep the old contents or to erase them. If NOERASE has the value
1598`new', a new mail buffer will be created instead of using the old
1599one. Any other non-nil value means to always select the old
1600buffer without erasing the contents.
1596 1601
1597The second through fifth arguments, 1602The second through fifth arguments,
1598 TO, SUBJECT, IN-REPLY-TO and CC, specify if non-nil 1603 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
1649;;; (file-exists-p buffer-auto-save-file-name)) 1654;;; (file-exists-p buffer-auto-save-file-name))
1650;;; (message "Auto save file for draft message exists; consider M-x mail-recover")) 1655;;; (message "Auto save file for draft message exists; consider M-x mail-recover"))
1651;;; t)) 1656;;; t))
1652 (pop-to-buffer "*mail*") 1657
1658 (if (eq noerase 'new)
1659 (pop-to-buffer (generate-new-buffer "*mail*"))
1660 (pop-to-buffer "*mail*"))
1661
1653 ;; Avoid danger that the auto-save file can't be written. 1662 ;; Avoid danger that the auto-save file can't be written.
1654 (let ((dir (expand-file-name 1663 (let ((dir (expand-file-name
1655 (file-name-as-directory mail-default-directory)))) 1664 (file-name-as-directory mail-default-directory))))
@@ -1664,7 +1673,8 @@ The seventh argument ACTIONS is a list of actions to take
1664 ;; (in case the user has actually visited a file *mail*). 1673 ;; (in case the user has actually visited a file *mail*).
1665; (set-visited-file-name nil) 1674; (set-visited-file-name nil)
1666 (let (initialized) 1675 (let (initialized)
1667 (and (not noerase) 1676 (and (or (not noerase)
1677 (eq noerase 'new))
1668 (if buffer-file-name 1678 (if buffer-file-name
1669 (if (buffer-modified-p) 1679 (if (buffer-modified-p)
1670 (when (y-or-n-p "Buffer has unsaved changes; reinitialize it and discard them? ") 1680 (when (y-or-n-p "Buffer has unsaved changes; reinitialize it and discard them? ")