aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1997-08-14 22:10:30 +0000
committerRichard M. Stallman1997-08-14 22:10:30 +0000
commit34153d7670098aad6fea11d97e5b84dca7767cec (patch)
treecf5a30126c192295e4cf13882aa02ea7188a334f
parentb402d19f2f3d030b16dc9cf8b82e319ecbfb9795 (diff)
downloademacs-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.el20
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
178the RMAIL summary buffer before returning, if it exists and this variable 178the RMAIL summary buffer before returning, if it exists and this variable
179is non-nil.") 179is non-nil.")
180 180
181(defvar mail-send-nonascii 'query
182 "*Specify whether to allow sending non-ASCII characters in mail.
183If t, that means do allow it. nil means don't allow it.
184`query' means ask the user each time.
185Including non-ASCII characters in a mail message can be problematical
186for 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)