diff options
| author | Richard M. Stallman | 1997-08-14 22:10:30 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-08-14 22:10:30 +0000 |
| commit | 34153d7670098aad6fea11d97e5b84dca7767cec (patch) | |
| tree | cf5a30126c192295e4cf13882aa02ea7188a334f | |
| parent | b402d19f2f3d030b16dc9cf8b82e319ecbfb9795 (diff) | |
| download | emacs-34153d7670098aad6fea11d97e5b84dca7767cec.tar.gz emacs-34153d7670098aad6fea11d97e5b84dca7767cec.zip | |
(mail-send): Ask for confirmation if
message contains non-ASCII characters.
(mail-send-nonascii): New variable.
| -rw-r--r-- | lisp/mail/sendmail.el | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index bd2e582efd0..55750ca03c2 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el | |||
| @@ -178,6 +178,13 @@ The functions \\[mail-send-on-exit] or \\[mail-dont-send] select | |||
| 178 | the RMAIL summary buffer before returning, if it exists and this variable | 178 | the RMAIL summary buffer before returning, if it exists and this variable |
| 179 | is non-nil.") | 179 | is non-nil.") |
| 180 | 180 | ||
| 181 | (defvar mail-send-nonascii 'query | ||
| 182 | "*Specify whether to allow sending non-ASCII characters in mail. | ||
| 183 | If t, that means do allow it. nil means don't allow it. | ||
| 184 | `query' means ask the user each time. | ||
| 185 | Including non-ASCII characters in a mail message can be problematical | ||
| 186 | for the recipient, who may not know how to decode them properly.") | ||
| 187 | |||
| 181 | ;; Note: could use /usr/ucb/mail instead of sendmail; | 188 | ;; Note: could use /usr/ucb/mail instead of sendmail; |
| 182 | ;; options -t, and -v if not interactive. | 189 | ;; options -t, and -v if not interactive. |
| 183 | (defvar mail-mailer-swallows-blank-line | 190 | (defvar mail-mailer-swallows-blank-line |
| @@ -555,7 +562,18 @@ the user from the mailer." | |||
| 555 | (y-or-n-p "Send buffer contents as mail message? ") | 562 | (y-or-n-p "Send buffer contents as mail message? ") |
| 556 | (or (buffer-modified-p) | 563 | (or (buffer-modified-p) |
| 557 | (y-or-n-p "Message already sent; resend? "))) | 564 | (y-or-n-p "Message already sent; resend? "))) |
| 558 | (let ((inhibit-read-only t)) | 565 | (let ((inhibit-read-only t) |
| 566 | (opoint (point))) | ||
| 567 | (when (and enable-multibyte-characters | ||
| 568 | (not (eq mail-send-nonascii t))) | ||
| 569 | (goto-char (point-min)) | ||
| 570 | (skip-chars-forward "\0-\177") | ||
| 571 | (or (= (point) (point-max)) | ||
| 572 | (if (eq mail-send-nonascii 'query) | ||
| 573 | (or (y-or-n-p "Message contains non-ASCII characters; send anyway? ") | ||
| 574 | (error "Aborted")) | ||
| 575 | (error "Message contains non-ASCII characters")))) | ||
| 576 | (goto-char opoint) | ||
| 559 | (run-hooks 'mail-send-hook) | 577 | (run-hooks 'mail-send-hook) |
| 560 | (message "Sending...") | 578 | (message "Sending...") |
| 561 | (funcall send-mail-function) | 579 | (funcall send-mail-function) |