bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RMAIL should ask for confirmation before sending mail


From: Ehud Karni
Subject: Re: RMAIL should ask for confirmation before sending mail
Date: Mon, 4 Nov 2002 16:35:15 +0200

On Mon, 4 Nov 2002 08:39:12 -0500 (EST), Jim Van Zandt <address@hidden> wrote:
> 
> I propose that mail-send-and-exit also ask for confirmation.  Several
> times, I have accidentally sent mail before I had finished editing it.
> This can be embarrassing, especially when there are a lot of
> addressees.  I believe that makes mail-send-and-exit a "dangerous"
> command. 

I have defined 2 functions to do this (plus renaming the *mail* buffer)
and it helped me a few times.

(defun mail-send-rename ( )
  "Don't send by accident, rename mail buffer to some sensible value"
       (interactive)
       (and (yes-or-no-p "Do you really want to send this mail")
           (let ((subj "(No Subject)"))
               (save-excursion
                   (goto-char (point-min))
                   (and (re-search-forward "^[Ss]ubject: " nil t)
                        (setq subj (buffer-substring (point) 
(line-end-position)))))
               (call-interactively 'mail-send)
               (rename-buffer (concat "*mail-" subj "-sent*") 'unique))))


(defun mail-send-rename-exit ( )
  "Bury buffer after sending"
       (interactive)
       (and (mail-send-rename)
            (bury-buffer)))

Now, assign the new functions to default keys:
    (define-key mail-mode-map "\C-c\C-c" 'mail-send-rename-exit)
    (define-key mail-mode-map "\C-c\C-s" 'mail-send-rename)

And you all set.

Ehud.


-- 
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 mailto:address@hidden                  Better  Safe  Than  Sorry




reply via email to

[Prev in Thread] Current Thread [Next in Thread]