changeset 18955:9612d2ae3960

(mail): Improve confirmation questions for file-visiting mail buffers.
author Richard M. Stallman <rms@gnu.org>
date Fri, 25 Jul 1997 00:10:37 +0000
parents c247e7c26139
children cd39a4a66613
files lisp/mail/sendmail.el
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/sendmail.el	Thu Jul 24 21:41:33 1997 +0000
+++ b/lisp/mail/sendmail.el	Fri Jul 25 00:10:37 1997 +0000
@@ -1237,10 +1237,19 @@
 ;  (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)