summaryrefslogtreecommitdiff
path: root/lisp/gnus
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>1997-09-26 01:50:55 +0000
committerKenichi Handa <handa@m17n.org>1997-09-26 01:50:55 +0000
commit5b68ad1300832ee4f48a14d10ec80d9424063f78 (patch)
tree37f9bf9b98036b91c36bbe1cfcecca14268a00e6 /lisp/gnus
parentfdee351aade821a5754a007c846057fed3e2fe4c (diff)
downloademacs-5b68ad1300832ee4f48a14d10ec80d9424063f78.tar.gz
Require nntp instead of gnus and message.
Set euc-kr for newsgroup "han". Delete code for add-hooking gnus-mule-initialize and setting coding system for nntp. Set default coding system for encoding to iso-latin-1. (gnus-mule-select-coding-system): Get a coding system of the current newsgroup from gnus-summary-buffer. (gnus-mule-decode-summary): Deleted. (gnus-mule-initialize): Add-hook gnus-mule-select-coding-system to gnus-parse-headers-hook. Don't add-hook gnus-mule-decode-summary and gnus-mule-decode-article. Don't set process coding system for nntp stream to 'no-conversion, instead set nntp-coding-system-for-read to 'binary. Set nnheader-file-coding-system and nnmail-file-coding-system to 'binary. Set nntp-coding-system-for-write to binary.
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/gnus-mule.el59
1 files changed, 21 insertions, 38 deletions
diff --git a/lisp/gnus/gnus-mule.el b/lisp/gnus/gnus-mule.el
index 75e224aace9..d3183743a9f 100644
--- a/lisp/gnus/gnus-mule.el
+++ b/lisp/gnus/gnus-mule.el
@@ -1,6 +1,6 @@
;;; gnus-mule.el --- Provide multilingual environment to GNUS
-;; Copyright (C) 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1995,1997 Free Software Foundation, Inc.
;; Copyright (C) 1995 Electrotechnical Laboratory, JAPAN.
;; Keywords: gnus, mule
@@ -24,10 +24,8 @@
;;; Commentary:
-;; This package enables GNUS to code convert automatically
+;; This package enables Gnus to code convert automatically
;; accoding to a coding system specified for each news group.
-;; Please put the following line in your .emacs:
-;; (add-hook 'gnus-startup-hook 'gnus-mule-initialize)
;; If you want to specify some coding system for a specific news
;; group, add the fllowing line in your .emacs:
;; (gnus-mule-add-group "xxx.yyy.zzz" 'some-coding-system)
@@ -37,8 +35,7 @@
;; appropriate coding system for as below:
;; (gnus-mule-add-group "" 'iso-2022-jp) ;; the case for Japanese
-(require 'gnus)
-(require 'message)
+(require 'nntp)
(defvar gnus-newsgroup-coding-systems nil
"Assoc list of news groups vs corresponding coding systems.
@@ -82,6 +79,7 @@ coding-system for reading and writing respectively."
(defvar gnus-mule-article-decoded nil)
;; Coding system for reading articles of the current news group.
(defvar gnus-mule-coding-system nil)
+;;(make-variable-buffer-local 'gnus-mule-coding-system)
(defvar gnus-mule-subject nil)
(defvar gnus-mule-decoded-subject nil)
(defvar gnus-mule-original-subject nil)
@@ -125,35 +123,21 @@ coding-system for reading and writing respectively."
;; Set `gnus-mule-coding-system' to the coding system articles of the
;; current news group is encoded. This function is set in
-;; `gnus-select-group-hook'.
+;; `gnus-parse-headers-hook'.
(defun gnus-mule-select-coding-system ()
- (let ((coding-system (gnus-mule-get-coding-system gnus-newsgroup-name)))
- (setq gnus-mule-coding-system
- (if (and coding-system (coding-system-p (car coding-system)))
- (car coding-system)))))
+ (save-excursion
+ (set-buffer gnus-summary-buffer)
+ (let ((coding-system (gnus-mule-get-coding-system gnus-newsgroup-name)))
+ (setq gnus-mule-coding-system
+ (if (and coding-system (coding-system-p (car coding-system)))
+ (car coding-system))))))
;; Decode the current article. This function is set in
-;; `gnus-article-prepare-hook'.
+;; `gnus-show-traditional-method'.
(defun gnus-mule-decode-article ()
(gnus-mule-code-convert gnus-mule-coding-system nil)
(setq gnus-mule-article-decoded t))
-;; Decode the current summary buffer. This function is set in
-;; `gnus-summary-generate-hook'.
-;; Made by <sangil@hugsvr.kaist.ac.kr>,
-;; coded by <crisp@hugsvr.kaist.ac.kr>.
-(defun gnus-mule-decode-summary ()
- (if gnus-mule-coding-system
- (mapcar
- (lambda (headers)
- (let ((subject (aref headers 1))
- (author (aref headers 2)))
- (aset headers 1
- (decode-coding-string subject gnus-mule-coding-system))
- (aset headers 2
- (decode-coding-string author gnus-mule-coding-system))))
- gnus-newsgroup-headers)))
-
(defun gnus-mule-toggle-article-format ()
"Toggle decoding/encoding of the current article buffer."
(interactive)
@@ -200,30 +184,29 @@ coding-system for reading and writing respectively."
(define-key gnus-article-mode-map "z" 'gnus-mule-toggle-article-format)
(define-key gnus-summary-mode-map "z" 'gnus-mule-toggle-article-format)
;; Hook definition
- (add-hook 'gnus-select-group-hook 'gnus-mule-select-coding-system)
- (add-hook 'gnus-summary-generate-hook 'gnus-mule-decode-summary)
- (add-hook 'gnus-article-prepare-hook 'gnus-mule-decode-article)
+ (add-hook 'gnus-parse-headers-hook 'gnus-mule-select-coding-system)
(add-hook 'message-send-news-hook
'gnus-mule-message-send-news-function)
(add-hook 'message-send-mail-hook
'gnus-mule-message-send-mail-function)
- (let ((stream (get-process "nntpd")))
- (if (processp stream)
- (set-process-coding-system stream 'no-conversion 'no-conversion))))
+ (setq nntp-coding-system-for-read 'binary
+ nntp-coding-system-for-write 'binary
+ nnheader-file-coding-system 'binary
+ nnmail-file-coding-system 'binary)
+ )
-(gnus-mule-add-group "" 'undecided)
+(gnus-mule-add-group "" '(undecided . iso-latin-1))
(gnus-mule-add-group "fj" 'iso-2022-7bit)
(gnus-mule-add-group "tnn" 'iso-2022-7bit)
(gnus-mule-add-group "japan" 'iso-2022-7bit)
(gnus-mule-add-group "pin" 'iso-2022-7bit)
+(gnus-mule-add-group "han" 'euc-kr)
(gnus-mule-add-group "alt.chinese.text" 'chinese-hz)
(gnus-mule-add-group "alt.hk" 'chinese-hz)
(gnus-mule-add-group "alt.chinese.text.big5" 'chinese-big5)
(gnus-mule-add-group "soc.culture.vietnamese" '(nil . vietnamese-viqr))
(gnus-mule-add-group "relcom" 'cyrillic-koi8)
-(add-hook 'gnus-startup-hook 'gnus-mule-initialize)
-
-(modify-coding-system-alist 'network "nntp" 'no-conversion)
+(provide 'gnus-mule)
;; gnus-mule.el ends here