(message-confirm-send): New variable to confirm sending a message.
authorTeodor Zlatanov <tzz@lifelogs.com>
Wed, 3 Sep 2008 17:43:35 +0000 (17:43 +0000)
committerTeodor Zlatanov <tzz@lifelogs.com>
Wed, 3 Sep 2008 17:43:35 +0000 (17:43 +0000)
(message-send): Use it.

lisp/ChangeLog
lisp/message.el

index dd48535..78558a9 100644 (file)
@@ -1,3 +1,8 @@
+2008-09-03  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * message.el (message-confirm-send): New variable to confirm sending a message.
+       (message-send): Use it.
+
 2008-08-30  Teodor Zlatanov  <tzz@lifelogs.com>
 
        * gnus-spec.el (gnus-parse-simple-format): Revert last patch.
index ac4de57..2932431 100644 (file)
@@ -441,6 +441,13 @@ nil means let mailer mail back a message to report errors."
   :link '(custom-manual "(message)Sending Variables")
   :type 'boolean)
 
+(defcustom message-confirm-send nil
+  "Non-nil means when sending a message ask for y/n confirmation."
+  :group 'message-sending
+  :group 'message-mail
+  :link '(custom-manual "(message)Sending Variables")
+  :type 'boolean)
+
 (defcustom message-generate-new-buffers 'unique
   "*Say whether to create a new message buffer to compose a message.
 Valid values include:
@@ -3962,6 +3969,9 @@ It should typically alter the sending method in some way or other."
     (put-text-property (point-min) (point-max) 'read-only nil))
   (message-fix-before-sending)
   (run-hooks 'message-send-hook)
+  (when message-confirm-send
+    (or (y-or-n-p "Send message? ")
+       (keyboard-quit)))
   (message message-sending-message)
   (let ((alist message-send-method-alist)
        (success t)