Mercurial > emacs
annotate lisp/gnus/gnus-mule.el @ 54329:182e62aed84e
(install): Don't try to copy ../lib-src/fns-*.el, as it isn't used anymore.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Wed, 10 Mar 2004 21:40:35 +0000 |
parents | 695cf19ef79e |
children | 375f2633d815 |
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 | 2 |
48588 | 3 ;; Copyright (C) 1995, 1997, 2002 Free Software Foundation, Inc. |
32162 | 4 ;; Copyright (C) 1995, 2000 Electrotechnical Laboratory, JAPAN. |
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 | 8 |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
25 | |
26 ;;; Commentary: | |
27 | |
28 ;; This file provides the function `gnus-mule-add-group' for backward | |
29 ;; compatibility with old version of Gnus included in Emacs 20. | |
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 | 33 (require 'gnus-sum) |
34 | |
35 ;;;###autoload | |
36 (defun gnus-mule-add-group (name coding-system) | |
37 "Specify that articles of news group NAME are encoded in CODING-SYSTEM. | |
38 All news groups deeper than NAME are also the target. | |
39 If CODING-SYSTEM is a cons, the car part is used and the cdr | |
40 part is ignored. | |
41 | |
48588 | 42 This function exists for backward compatibility with Emacs 20. It is |
32162 | 43 recommended to customize the variable `gnus-group-charset-alist' |
44 rather than using this function." | |
45 (if (consp coding-system) | |
46 ;; Ignore the cdr part because now Gnus can't use different | |
47 ;; coding systems for encoding and decoding. | |
48 (setq coding-system (car coding-system))) | |
49 (let ((tail gnus-group-charset-alist) | |
50 (prev nil) | |
51 (pattern (concat "^" (regexp-quote name)))) | |
52 ;; Check entries of `gnus-group-charset-alist' if they match NAME. | |
53 (while (not (string-match (car (car tail)) name)) | |
54 (setq prev tail tail (cdr tail))) | |
55 (if tail | |
56 ;; A matching entry was found. | |
57 (if (string= pattern (car (car tail))) | |
58 ;; We can modify this entry. | |
59 (setcar (cdr (car tail)) coding-system) | |
60 ;; We must add a new entry before this. | |
61 (if prev | |
62 (setcdr prev (cons (list pattern coding-system) | |
63 (cdr prev))) | |
64 (setq gnus-group-charset-alist | |
65 (cons (list pattern coding-system) | |
66 gnus-group-charset-alist)))) | |
67 ;; We must prepend a new entry. | |
68 (setq gnus-group-charset-alist | |
69 (cons (list pattern coding-system) | |
70 gnus-group-charset-alist))))) | |
71 | |
72 (provide 'gnus-mule) | |
73 | |
52401 | 74 ;;; arch-tag: 525e6b69-85de-4dfc-9dbb-764c795d63af |
38412
253f761ad37b
Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents:
32990
diff
changeset
|
75 ;;; gnus-mule.el ends here |