aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa1998-08-24 01:46:43 +0000
committerKenichi Handa1998-08-24 01:46:43 +0000
commit46babb23b62952f2bb237584855704f6d01fa351 (patch)
tree21c3186c34f3f4ff5ff4c3b062d5d2a0b8da8edb
parentda241b5c3c830632c3e83426ffcd9ad9dfe2b01e (diff)
downloademacs-46babb23b62952f2bb237584855704f6d01fa351.tar.gz
emacs-46babb23b62952f2bb237584855704f6d01fa351.zip
(select-message-coding-system): New
function. (set-language-environment-coding-systems): Set default-sendmail-coding-system.
-rw-r--r--lisp/international/mule-cmds.el24
1 files changed, 24 insertions, 0 deletions
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 2ebc5f147a8..c2874981750 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -489,6 +489,29 @@ Please select one from the following safe coding systems:\n"
489 489
490(setq select-safe-coding-system-function 'select-safe-coding-system) 490(setq select-safe-coding-system-function 'select-safe-coding-system)
491 491
492(defun select-message-coding-system ()
493 "Return a coding system to encode the outgoing message of the current buffer.
494It at first tries the first coding system found in these variables
495in this order:
496 (1) local value of `buffer-file-coding-system'
497 (2) value of `sendmail-coding-system'
498 (3) value of `default-buffer-file-coding-system'
499 (4) value of `default-sendmail-coding-system'
500If the found coding system can't encode the current buffer,
501or none of them are bound to a coding system,
502it asks a user to select a proper coding system."
503 (let ((coding (or (and (local-variable-p 'buffer-file-coding-system)
504 buffer-file-coding-system)
505 sendmail-coding-system
506 default-buffer-file-coding-system
507 default-sendmail-coding-system)))
508 (if (eq coding 'no-conversion)
509 ;; We should never use no-conversion for outgoing mails.
510 (setq coding nil))
511 (if (fboundp select-safe-coding-system-function)
512 (funcall select-safe-coding-system-function
513 (point-min) (point-max) coding)
514 coding)))
492 515
493;;; Language support staffs. 516;;; Language support staffs.
494 517
@@ -1189,6 +1212,7 @@ specifies the character set for the major languages of Western Europe."
1189 (if priority 1212 (if priority
1190 (let ((categories (mapcar 'coding-system-category priority))) 1213 (let ((categories (mapcar 'coding-system-category priority)))
1191 (set-default-coding-systems default-coding) 1214 (set-default-coding-systems default-coding)
1215 (setq default-sendmail-coding-system default-coding)
1192 (set-coding-priority categories) 1216 (set-coding-priority categories)
1193 (while priority 1217 (while priority
1194 (set (car categories) (car priority)) 1218 (set (car categories) (car priority))