2 ;;; gnus-charset.el --- MIME charset extension for Gnus
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1995,1996 MORIOKA Tomohiko
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
10 ;;; $Id: gnus-charset.el,v 0.1 1996/08/06 12:07:28 morioka Exp $
11 ;;; Keywords: news, MIME, multimedia, multilingual, encoded-word
13 ;;; This file is not part of GNU Emacs yet.
15 ;;; This program is free software; you can redistribute it and/or
16 ;;; modify it under the terms of the GNU General Public License as
17 ;;; published by the Free Software Foundation; either version 2, or
18 ;;; (at your option) any later version.
20 ;;; This program is distributed in the hope that it will be useful,
21 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 ;;; General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with This program. If not, write to the Free Software
27 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
31 (defvar running-xemacs (string-match "XEmacs" emacs-version))
32 (defvar running-xemacs-20 (and running-xemacs
33 (= emacs-major-version 20)))
36 ;;; @ newsgroup default charset
39 (defvar gnus-newsgroup-default-charset-alist nil)
41 (defun gnus-set-newsgroup-default-charset (newsgroup charset)
42 "Set CHARSET for the NEWSGROUP as default MIME charset."
43 (set-alist 'gnus-newsgroup-default-charset-alist
44 (concat "^" (regexp-quote newsgroup) "\\($\\|\\.\\)")
48 ;;; @ for mule (Multilingual support)
53 (cond ((boundp 'MULE) ; for MULE 1.* and 2.*.
54 (defun gnus-set-nntp-coding-system ()
55 (define-service-coding-system gnus-nntp-service nil *noconv*)
57 (add-hook 'gnus-open-server-hook 'gnus-set-nntp-coding-system)
60 (or (boundp '*noconv*)
61 (defconst *noconv* 'noconv)
66 (defun nnheader-find-file-noselect (filename &optional nowarn rawfile)
67 (let ((file-coding-system-for-read *noconv*))
68 (find-file-noselect filename nowarn rawfile)
70 (defun nnheader-insert-file-contents-literally
71 (filename &optional visit beg end replace)
72 (let ((file-coding-system-for-read *noconv*))
73 (insert-file-contents-literally filename visit beg end replace)
79 (defun nnmail-find-file (file)
80 "Insert FILE in server buffer safely. [tm-gnus5.el]"
81 (set-buffer nntp-server-buffer)
83 (let ((format-alist nil)
84 (after-insert-file-functions ; for jam-code-guess
85 (if (memq 'jam-code-guess-after-insert-file-function
86 after-insert-file-functions)
87 '(jam-code-guess-after-insert-file-function)))
88 (file-coding-system-for-read *noconv*))
90 (progn (insert-file-contents file) t)
93 (defun gnus-prepare-save-mail-function ()
94 (setq file-coding-system *noconv*)
96 (add-hook 'nnmail-prepare-save-mail-hook
97 'gnus-prepare-save-mail-function)
99 (gnus-set-newsgroup-default-charset "alt.chinese" 'hz)
100 (gnus-set-newsgroup-default-charset "alt.chinese.text.big5" 'big5)
101 (gnus-set-newsgroup-default-charset "tw" 'big5)
102 (gnus-set-newsgroup-default-charset "hk" 'big5)
103 (gnus-set-newsgroup-default-charset "hkstar" 'big5)
104 (gnus-set-newsgroup-default-charset "han" 'euc-kr)
105 (gnus-set-newsgroup-default-charset "relcom" 'koi8-r)
112 (provide 'gnus-charset)
114 ;;; gnus-charset.el ends here