Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Brep <brep@smth.org>
Subject: Re: How to change encoding temporarily?
Date: Fri, 17 Nov 2006 23:53:51 +0800	[thread overview]
Message-ID: <ubqn6rrw0.fsf@gmail.com> (raw)
In-Reply-To: <y7qakwyp.fsf@163.com>

ssSslang <sssslang@163.com.removeme> writes:

> Thank you, Reiner. I saw these hooks, but they're not related to mail
> address. Do you mean I should write a function to select the encoding
> according to the From header, and then bind it to the hook?

Try this:

(add-hook 'message-send-hook 'change-charset)
(defun change-charset ()
  (when (message-mail-p)
    (if (string-match "hotmail" (mail-fetch-field "to"))
	(setq mm-coding-system-priorities
	      '(iso-8859-1 gbk utf-8))
      (setq mm-coding-system-priorities
	    '(iso-8859-1 utf-8)))))

  reply	other threads:[~2006-11-17 15:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-17 12:28 ssSslang
2006-11-17 13:16 ` Reiner Steib
2006-11-17 13:46   ` ssSslang
2006-11-17 15:53     ` Brep [this message]
2006-11-17 19:33       ` Reiner Steib
2006-11-17 21:27         ` Zhang Wei
2006-11-18  6:37           ` ssSslang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ubqn6rrw0.fsf@gmail.com \
    --to=brep@smth.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).