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