annotate lisp/gnus/gnus-mule.el @ 37223:6ae575a7a695

(defface menu): Doc fix.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 05 Apr 2001 16:15:50 +0000
parents a2bbecad7065
children 253f761ad37b
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
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
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
31 (require 'gnus-sum)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
32
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
33 ;;;###autoload
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
34 (defun gnus-mule-add-group (name coding-system)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
35 "Specify that articles of news group NAME are encoded in CODING-SYSTEM.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
36 All news groups deeper than NAME are also the target.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
37 If CODING-SYSTEM is a cons, the car part is used and the cdr
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
38 part is ignored.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
39
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
40 This function exists for backward comaptibility with Emacs 20. It is
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
41 recommended to customize the variable `gnus-group-charset-alist'
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
42 rather than using this function."
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
43 (if (consp coding-system)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
44 ;; Ignore the cdr part because now Gnus can't use different
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
45 ;; coding systems for encoding and decoding.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
46 (setq coding-system (car coding-system)))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
47 (let ((tail gnus-group-charset-alist)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
48 (prev nil)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
49 (pattern (concat "^" (regexp-quote name))))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
50 ;; Check entries of `gnus-group-charset-alist' if they match NAME.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
51 (while (not (string-match (car (car tail)) name))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
52 (setq prev tail tail (cdr tail)))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
53 (if tail
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
54 ;; A matching entry was found.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
55 (if (string= pattern (car (car tail)))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
56 ;; We can modify this entry.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
57 (setcar (cdr (car tail)) coding-system)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
58 ;; We must add a new entry before this.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
59 (if prev
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
60 (setcdr prev (cons (list pattern coding-system)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
61 (cdr prev)))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
62 (setq gnus-group-charset-alist
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
63 (cons (list pattern coding-system)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
64 gnus-group-charset-alist))))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
65 ;; We must prepend a new entry.
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
66 (setq gnus-group-charset-alist
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
67 (cons (list pattern coding-system)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
68 gnus-group-charset-alist)))))
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
69
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
70 (provide 'gnus-mule)
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
71
a2d9d6410ef5 Revived
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
72 ;; gnus-mule.el ends here