annotate lisp/gnus/gnus-mule.el @ 32407:ca7ec5a76115

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