Function: select-message-coding-system

select-message-coding-system is a byte-compiled function defined in mule-cmds.el.gz.

Signature

(select-message-coding-system)

Documentation

Return a coding system to encode the outgoing message of the current buffer.

It at first tries the first coding system found in these variables in this order:
  (1) local value of buffer-file-coding-system
  (2) value of sendmail-coding-system
  (3) value of default-sendmail-coding-system
  (4) default value of buffer-file-coding-system
If the found coding system can't encode the current buffer, or none of them are bound to a coding system, it asks the user to select a proper coding system.

Source Code

;; Defined in /usr/src/emacs/lisp/international/mule-cmds.el.gz
(defun select-message-coding-system ()
  "Return a coding system to encode the outgoing message of the current buffer.
It at first tries the first coding system found in these variables
in this order:
  (1) local value of `buffer-file-coding-system'
  (2) value of `sendmail-coding-system'
  (3) value of `default-sendmail-coding-system'
  (4) default value of `buffer-file-coding-system'
If the found coding system can't encode the current buffer,
or none of them are bound to a coding system,
it asks the user to select a proper coding system."
  (let ((coding (or (and (local-variable-p 'buffer-file-coding-system)
			  buffer-file-coding-system)
		     sendmail-coding-system
		     default-sendmail-coding-system
		     (default-value 'buffer-file-coding-system))))
    (if (eq coding 'no-conversion)
	;; We should never use no-conversion for outgoing mail.
	(setq coding nil))
    (if (fboundp select-safe-coding-system-function)
	(funcall select-safe-coding-system-function
		 (point-min) (point-max) coding
                 (lambda (x) (coding-system-get x :mime-charset)))
      coding)))