annotate lisp/gnus/gnus-mule.el @ 48540:283a6d8bdf2b

Comment.
author Dave Love <fx@gnu.org>
date Mon, 25 Nov 2002 19:06:07 +0000
parents 253f761ad37b
children 52d99cc2e9e3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 32990
diff changeset
1 ;;; gnus-mule.el --- provide backward compatibility function to GNUS
32162
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
2
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
3 ;; Copyright (C) 1995,1997 Free Software Foundation, Inc.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
4 ;; Copyright (C) 1995, 2000 Electrotechnical Laboratory, JAPAN.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
5
32990
a2bbecad7065 Add maintainer and modify keywords header.
Dave Love <fx@gnu.org>
parents: 32162
diff changeset
6 ;; Maintainer: FSF
a2bbecad7065 Add maintainer and modify keywords header.
Dave Love <fx@gnu.org>
parents: 32162
diff changeset
7 ;; Keywords: news, i18n
32162
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
8
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
10
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
14 ;; any later version.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
15
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
19 ;; GNU General Public License for more details.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
20
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
24 ;; Boston, MA 02111-1307, USA.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
25
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
26 ;;; Commentary:
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
27
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
28 ;; This file provides the function `gnus-mule-add-group' for backward
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
29 ;; compatibility with old version of Gnus included in Emacs 20.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
30
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 32990
diff changeset
31 ;;; Code:
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 32990
diff changeset
32
32162
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
33 (require 'gnus-sum)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
34
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
35 ;;;###autoload
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
36 (defun gnus-mule-add-group (name coding-system)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
37 "Specify that articles of news group NAME are encoded in CODING-SYSTEM.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
38 All news groups deeper than NAME are also the target.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
39 If CODING-SYSTEM is a cons, the car part is used and the cdr
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
40 part is ignored.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
41
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
42 This function exists for backward comaptibility with Emacs 20. It is
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
43 recommended to customize the variable `gnus-group-charset-alist'
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
44 rather than using this function."
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
45 (if (consp coding-system)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
46 ;; Ignore the cdr part because now Gnus can't use different
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
47 ;; coding systems for encoding and decoding.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
48 (setq coding-system (car coding-system)))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
49 (let ((tail gnus-group-charset-alist)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
50 (prev nil)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
51 (pattern (concat "^" (regexp-quote name))))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
52 ;; Check entries of `gnus-group-charset-alist' if they match NAME.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
53 (while (not (string-match (car (car tail)) name))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
54 (setq prev tail tail (cdr tail)))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
55 (if tail
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
56 ;; A matching entry was found.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
57 (if (string= pattern (car (car tail)))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
58 ;; We can modify this entry.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
59 (setcar (cdr (car tail)) coding-system)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
60 ;; We must add a new entry before this.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
61 (if prev
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
62 (setcdr prev (cons (list pattern coding-system)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
63 (cdr prev)))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
64 (setq gnus-group-charset-alist
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
65 (cons (list pattern coding-system)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
66 gnus-group-charset-alist))))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
67 ;; We must prepend a new entry.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
68 (setq gnus-group-charset-alist
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
69 (cons (list pattern coding-system)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
70 gnus-group-charset-alist)))))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
71
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
72 (provide 'gnus-mule)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
73
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 32990
diff changeset
74 ;;; gnus-mule.el ends here