diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-07-25 00:10:37 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-07-25 00:10:37 +0000 |
commit | 4d7ba805400359ac3ae83c0ebbe08c41a1238aa4 (patch) | |
tree | 4ae5b89f45475fa20db594451f1fb85078834c6a /lisp/mail/sendmail.el | |
parent | 0f3e6815c161e3e84e4f30805b3b92c38f2fc7f3 (diff) | |
download | emacs-4d7ba805400359ac3ae83c0ebbe08c41a1238aa4.tar.gz |
(mail): Improve confirmation questions for file-visiting mail buffers.
Diffstat (limited to 'lisp/mail/sendmail.el')
-rw-r--r-- | lisp/mail/sendmail.el | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 6fe9349f622..8ad9778f845 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -1237,10 +1237,19 @@ The seventh argument ACTIONS is a list of actions to take ; (set-visited-file-name nil) (let (initialized) (and (not noerase) - (or (not (buffer-modified-p)) - (if buffer-file-name - (y-or-n-p "Buffer is modified; erase it and reinitialize? ") - (y-or-n-p "Unsent message being composed; erase it? "))) + (if buffer-file-name + (if (buffer-modified-p) + (when (y-or-n-p "Buffer has unsaved changes; reinitialize it and discard them? ") + (if (y-or-n-p "Disconnect buffer from visited file? ") + (set-visited-file-name nil)) + t) + (when (y-or-n-p "Reinitialize buffer, and disconnect it from the visited file? ") + (set-visited-file-name nil) + t)) + ;; A non-file-visiting buffer. + (if (buffer-modified-p) + (y-or-n-p "Unsent message being composed; erase it? ") + t)) (let ((inhibit-read-only t)) (erase-buffer) (mail-setup to subject in-reply-to cc replybuffer actions) |