summaryrefslogtreecommitdiff
path: root/lisp/gnus
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/ChangeLog.unicode138
-rw-r--r--lisp/gnus/gnus-start.el8
-rw-r--r--lisp/gnus/mm-bodies.el3
-rw-r--r--lisp/gnus/mm-util.el79
-rw-r--r--lisp/gnus/mml.el3
-rw-r--r--lisp/gnus/rfc2047.el4
-rw-r--r--lisp/gnus/rfc2104.el14
7 files changed, 164 insertions, 85 deletions
diff --git a/lisp/gnus/ChangeLog.unicode b/lisp/gnus/ChangeLog.unicode
new file mode 100644
index 00000000000..bee0154febc
--- /dev/null
+++ b/lisp/gnus/ChangeLog.unicode
@@ -0,0 +1,138 @@
+2006-11-27 Zhang Wei <id.brep@gmail.com>
+
+ * rfc2047.el (rfc2047-charset-encoding-alist): Add gbk and GB18030.
+
+ * mm-util.el (mm-mime-mule-charset-alist): Add gbk and GB18030.
+
+2006-09-25 Kenichi Handa <handa@m17n.org>
+
+ * gnus-start.el (gnus-gnus-to-quick-newsrc-format): Use correct
+ form for specifying a mode in the header line.
+
+2004-09-27 Miles Bader <miles@gnu.org>
+
+ * mml.el (mml-parse-1): Remove apparently vestigial use of
+ `mm-hack-charsets'.
+ * mm-bodies.el (mm-encode-body): Likewise.
+
+2003-11-17 Kenichi Handa <handa@m17n.org>
+
+ * mm-util.el (mm-enable-multibyte): Call set-buffer-multibyte
+ with the arg `to'.
+
+2003-11-13 Kenichi Handa <handa@m17n.org>
+
+ * rfc2104.el (rfc2104-hexstring-to-byte-list): Renamed from
+ rfc2104-hexstring-to-bitstring and changed to return a byte list.
+ (rfc2104-hash): Convert the result of concat to unibyte string.
+
+2002-10-16 Dave Love <fx@gnu.org>
+
+ * mm-bodies.el (mm-encode-body): Doc fix.
+
+ * qp.el (quoted-printable-encode-region): Fix non-Emacs 22 case.
+
+2002-10-09 Dave Love <fx@gnu.org>
+
+ * qp.el (quoted-printable-encode-region): Fix non-multibyte search
+ for Emacs 22.
+
+2002-10-07 Dave Love <fx@gnu.org>
+
+ * qp.el (quoted-printable-encode-region): Go to start of range
+ before searching.
+ (quoted-printable-encode-region): Use multibyte-char-to-unibyte.
+
+2002-09-05 Dave Love <fx@gnu.org>
+
+ * qp.el (quoted-printable-decode-region): Use mm-insert-byte.
+
+ * mm-util.el (mm-hack-charsets, mm-iso-8859-15-compatible)
+ (mm-iso-8859-x-to-15-table, mm-iso-8859-x-to-15-region): Deleted.
+ (mm-find-mime-charset-region): Remove hack-charsets stuff.
+ (mm-insert-byte): New.
+
+ * rfc2047.el (message-posting-charset): defvar when compiling.
+ (rfc2047-header-encoding-alist): Add `address-mime' part.
+ (rfc2047-charset-encoding-alist): Use B for iso-8859-7. Doc fix.
+ (rfc2047-q-encoding-alist): Augment header list.
+ (rfc2047-encodable-p): Use mm-find-mime-charset-region.
+ (rfc2047-special-chars, rfc2047-non-special-chars): New.
+ (rfc2047-dissect-region, rfc2047-encode-region, rfc2047-encode):
+ Rewritten to avoid charset stuff and to take account of rfc2822
+ tokens.
+ (rfc2047-encode-message-header): Don't include header name field
+ in encoding. Add `address-mime' case and bind
+ rfc2047-special-chars for `mime' case.
+
+2002-08-21 Kenichi Handa <handa@etl.go.jp>
+
+ * qp.el (quoted-printable-decode-region): Insert bytes by
+ `insert-byte'.
+
+2002-08-18 Dave Love <fx@gnu.org>
+
+ * rfc2047.el (rfc2047-encode): Fix last change.
+
+2002-07-30 Dave Love <fx@gnu.org>
+
+ * rfc2047.el (rfc2047-charset-encoding-alist): Use B for Hebrew.
+ Doc fix.
+
+ * gnus-start.el (gnus-read-newsrc-el-file): Don't bind
+ coding-system-for-read.
+ (gnus-gnus-to-quick-newsrc-format): Insert coding cookie.
+
+2002-07-09 Dave Love <fx@gnu.org>
+
+ * mm-util.el (mm-find-mime-charset-region): Fix :mime-charset
+ part.
+
+2002-06-26 Dave Love <fx@gnu.org>
+
+ * rfc2047.el (rfc2047-encodable-p): Avoid mm-find-charset-region.
+ (rfc2047-dissect-region): Don't record charsets.
+ (rfc2047-encode): Remove arg CHARSET.
+ (rfc2047-encode-region): Change rfc2047-encode call.
+
+2002-06-24 Dave Love <fx@gnu.org>
+
+ * mm-util.el (mm-mule4-p, mm-enable-multibyte-mule4)
+ (mm-disable-multibyte-mule4)
+ (mm-with-unibyte-current-buffer-mule4): Deleted.
+
+ * gnus-sum.el (gnus-summary-mode, gnus-summary-display-article)
+ (gnus-summary-select-article, gnus-summary-edit-article): Use
+ mm-{en,dis}able-multibyte, not mm-{en,dis}able-multibyte-mule4.
+
+ * message.el (message-forward-make-body): Use
+ mm-{en,dis}able-multibyte, not mm-{en,dis}able-multibyte-mule4.
+
+ * qp.el (quoted-printable-encode-region): Avoid
+ find-charset-region.
+
+ * mm-bodies.el (mm-body-7-or-8): Don't special-case Mule.
+ (mm-encode-body): Just call mm-encode-coding-region in encoding
+ case.
+
+2002-05-27 Dave Love <fx@gnu.org>
+
+ * mm-util.el (mm-auto-save-coding-system): Prefer utf-8-emacs
+ coding system to emacs-mule.
+
+2002-05-14 Dave Love <fx@gnu.org>
+
+ * mm-util.el (mm-mime-mule-charset-alist)
+ (mm-mule-charset-to-mime-charset, mm-charset-to-coding-system)
+ (mm-mime-charset, mm-find-mime-charset-region): Look for
+ `:mime-charset' property of coding systems before `mime-charset'.
+
+;; Local Variables:
+;; coding: iso-2022-7bit
+;; End:
+
+ Copyright (C) 2002 Free Software Foundation, Inc.
+ Copying and distribution of this file, with or without modification,
+ are permitted provided the copyright notice and this notice are preserved.
+
+;;; arch-tag: d7f0febd-4aca-429a-9493-d71cd04ad9f0
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 22a807b77a7..0486392818e 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -458,6 +458,8 @@ Can be used to turn version control on or off."
;;; Internal variables
+;; Fixme: deal with old emacs-mule when mm-universal-coding-system is
+;; utf-8-emacs.
(defvar gnus-ding-file-coding-system mm-universal-coding-system
"Coding system for ding file.")
@@ -2371,8 +2373,7 @@ If FORCE is non-nil, the .newsrc file is read."
;; We always, always read the .eld file.
(gnus-message 5 "Reading %s..." ding-file)
(let (gnus-newsrc-assoc)
- (let ((coding-system-for-read gnus-ding-file-coding-system))
- (gnus-load ding-file))
+ (gnus-load ding-file)
;; Older versions of `gnus-format-specs' are no longer valid
;; in Oort Gnus 0.01.
(let ((version
@@ -2802,7 +2803,8 @@ If FORCE is non-nil, the .newsrc file is read."
(defun gnus-gnus-to-quick-newsrc-format (&optional minimal name &rest specific-variables)
"Print Gnus variables such as `gnus-newsrc-alist' in Lisp format."
- (princ ";; -*- emacs-lisp -*-\n")
+ (princ (format ";; -*- mode:emacs-lisp; coding: %s; -*-\n"
+ gnus-ding-file-coding-system))
(if name
(princ (format ";; %s\n" name))
(princ ";; Gnus startup file.\n"))
diff --git a/lisp/gnus/mm-bodies.el b/lisp/gnus/mm-bodies.el
index a10b8b28399..a1d51a1b9ea 100644
--- a/lisp/gnus/mm-bodies.el
+++ b/lisp/gnus/mm-bodies.el
@@ -101,8 +101,7 @@ If no encoding was done, nil is returned."
(mm-charset-to-coding-system charset))
charset)
(goto-char (point-min))
- (let ((charsets (mm-find-mime-charset-region (point-min) (point-max)
- mm-hack-charsets)))
+ (let ((charsets (mm-find-mime-charset-region (point-min) (point-max))))
(cond
;; No encoding.
((null charsets)
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 10cd78f71d9..402e824af23 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -450,6 +450,10 @@ could use `autoload-coding-system' here."
(iso-2022-jp latin-jisx0201 japanese-jisx0208 japanese-jisx0208-1978)
(euc-kr korean-ksc5601)
(gb2312 chinese-gb2312)
+ (gbk chinese-gbk)
+ (gb18030 gb18030-2-byte
+ gb18030-4-byte-bmp gb18030-4-byte-smp
+ gb18030-4-byte-ext-1 gb18030-4-byte-ext-2)
(big5 chinese-big5-1 chinese-big5-2)
(tibetan tibetan)
(thai-tis620 thai-tis620)
@@ -518,7 +522,7 @@ with Mule charsets. It is completely useless for Emacs."
cs mime mule alist)
(while css
(setq cs (pop css)
- mime (or (coding-system-get cs :mime-charset) ; Emacs 23 (unicode)
+ mime (or (coding-system-get cs :mime-charset); Emacs 23 (unicode)
(coding-system-get cs 'mime-charset)))
(when (and mime
(not (eq t (setq mule
@@ -527,36 +531,6 @@ with Mule charsets. It is completely useless for Emacs."
(push (cons mime (delq 'ascii mule)) alist)))
(setq mm-mime-mule-charset-alist (nreverse alist)))))
-(defvar mm-hack-charsets '(iso-8859-15 iso-2022-jp-2)
- "A list of special charsets.
-Valid elements include:
-`iso-8859-15' convert ISO-8859-1, -9 to ISO-8859-15 if ISO-8859-15 exists.
-`iso-2022-jp-2' convert ISO-2022-jp to ISO-2022-jp-2 if ISO-2022-jp-2 exists."
-)
-
-(defvar mm-iso-8859-15-compatible
- '((iso-8859-1 "\xA4\xA6\xA8\xB4\xB8\xBC\xBD\xBE")
- (iso-8859-9 "\xA4\xA6\xA8\xB4\xB8\xBC\xBD\xBE\xD0\xDD\xDE\xF0\xFD\xFE"))
- "ISO-8859-15 exchangeable coding systems and inconvertible characters.")
-
-(defvar mm-iso-8859-x-to-15-table
- (and (fboundp 'coding-system-p)
- (mm-coding-system-p 'iso-8859-15)
- (mapcar
- (lambda (cs)
- (if (mm-coding-system-p (car cs))
- (let ((c (string-to-char
- (decode-coding-string "\341" (car cs)))))
- (cons (char-charset c)
- (cons
- (- (string-to-char
- (decode-coding-string "\341" 'iso-8859-15)) c)
- (string-to-list (decode-coding-string (car (cdr cs))
- (car cs))))))
- '(gnus-charset 0)))
- mm-iso-8859-15-compatible))
- "A table of the difference character between ISO-8859-X and ISO-8859-15.")
-
(defcustom mm-coding-system-priorities
(if (boundp 'current-language-environment)
(let ((lang (symbol-value 'current-language-environment)))
@@ -813,27 +787,6 @@ This affects whether coding conversion should be attempted generally."
default-enable-multibyte-characters
t)))
-(defun mm-iso-8859-x-to-15-region (&optional b e)
- (if (fboundp 'char-charset)
- (let (charset item c inconvertible)
- (save-restriction
- (if e (narrow-to-region b e))
- (goto-char (point-min))
- (skip-chars-forward "\0-\177")
- (while (not (eobp))
- (cond
- ((not (setq item (assq (char-charset (setq c (char-after)))
- mm-iso-8859-x-to-15-table)))
- (forward-char))
- ((memq c (cdr (cdr item)))
- (setq inconvertible t)
- (forward-char))
- (t
- (insert-before-markers (prog1 (+ c (car (cdr item)))
- (delete-char 1)))))
- (skip-chars-forward "\0-\177")))
- (not inconvertible))))
-
(defun mm-sort-coding-systems-predicate (a b)
(let ((priorities
(mapcar (lambda (cs)
@@ -970,32 +923,14 @@ charset, and a longer list means no appropriate charset."
;; Otherwise, we'll get nil, and the next setq will get invoked.
(setq charsets (mm-xemacs-find-mime-charset b e))
+ ;; Fixme: won't work for unibyte Emacs 23:
+
;; We're not multibyte, or a single coding system won't cover it.
(setq charsets
(mm-delete-duplicates
(mapcar 'mm-mime-charset
(delq 'ascii
(mm-find-charset-region b e))))))
- (if (and (> (length charsets) 1)
- (memq 'iso-8859-15 charsets)
- (memq 'iso-8859-15 hack-charsets)
- (save-excursion (mm-iso-8859-x-to-15-region b e)))
- (mapcar (lambda (x) (setq charsets (delq (car x) charsets)))
- mm-iso-8859-15-compatible))
- (if (and (memq 'iso-2022-jp-2 charsets)
- (memq 'iso-2022-jp-2 hack-charsets))
- (setq charsets (delq 'iso-2022-jp charsets)))
- ;; Attempt to reduce the number of charsets if utf-8 is available.
- (if (and (featurep 'xemacs)
- (> (length charsets) 1)
- (mm-coding-system-p 'utf-8))
- (let ((mm-coding-system-priorities
- (cons 'utf-8 mm-coding-system-priorities)))
- (setq charsets
- (mm-delete-duplicates
- (mapcar 'mm-mime-charset
- (delq 'ascii
- (mm-find-charset-region b e)))))))
charsets))
(defmacro mm-with-unibyte-buffer (&rest forms)
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 0ae4487f869..9744ab0ac86 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -233,8 +233,7 @@ part. This is for the internal use, you should never modify the value.")
(list
(intern (downcase (cdr (assq 'charset tag))))))
(t
- (mm-find-mime-charset-region point (point)
- mm-hack-charsets))))
+ (mm-find-mime-charset-region point (point)))))
(when (and (not raw) (memq nil charsets))
(if (or (memq 'unknown-encoding mml-confirmation-set)
(message-options-get 'unknown-encoding)
diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el
index 4fd60ed8f74..4ac26c16158 100644
--- a/lisp/gnus/rfc2047.el
+++ b/lisp/gnus/rfc2047.el
@@ -107,6 +107,8 @@ The values can be:
(iso-2022-jp . B)
(iso-2022-kr . B)
(gb2312 . B)
+ (gbk . B)
+ (gb18030 . B)
(big5 . B)
(cn-big5 . B)
(cn-gb . B)
@@ -326,7 +328,7 @@ The buffer may be narrowed."
;; (make-char-table 'syntax-table '(2)) only works in Emacs.
(let ((table (make-syntax-table)))
;; The following is done to work for setting all elements of the table
- ;; in Emacs 21 and 22 and XEmacs; it appears to be the cleanest way.
+ ;; in Emacs 21-23 and XEmacs; it appears to be the cleanest way.
;; Play safe and don't assume the form of the word syntax entry --
;; copy it from ?a.
(if (fboundp 'set-char-table-range) ; Emacs
diff --git a/lisp/gnus/rfc2104.el b/lisp/gnus/rfc2104.el
index e24506ef363..e0727984bb4 100644
--- a/lisp/gnus/rfc2104.el
+++ b/lisp/gnus/rfc2104.el
@@ -53,6 +53,7 @@
;;; 1999-10-23 included in pgnus
;;; 2000-08-15 `rfc2104-hexstring-to-bitstring'
;;; 2000-05-12 added sha-1 example, added test case reference
+;;; 2003-11-13 change rfc2104-hexstring-to-bitstring to ...-byte-list
;;; Code:
@@ -88,12 +89,12 @@
(rfc2104-hex-to-int (reverse (append str nil))))
0))
-(defun rfc2104-hexstring-to-bitstring (str)
+(defun rfc2104-hexstring-to-byte-list (str)
(let (out)
(while (< 0 (length str))
(push (rfc2104-hex-to-int (substring str -2)) out)
(setq str (substring str 0 -2)))
- (concat out)))
+ out))
(defun rfc2104-hash (hash block-length hash-length key text)
(let* (;; if key is longer than B, reset it to HASH(key)
@@ -110,9 +111,12 @@
(setq k_ipad (mapcar (lambda (c) (logxor c rfc2104-ipad)) k_ipad))
(setq k_opad (mapcar (lambda (c) (logxor c rfc2104-opad)) k_opad))
;; perform outer hash
- (funcall hash (concat k_opad (rfc2104-hexstring-to-bitstring
- ;; perform inner hash
- (funcall hash (concat k_ipad text)))))))
+ (funcall hash
+ (encode-coding-string
+ (concat k_opad (rfc2104-hexstring-to-byte-list
+ ;; perform inner hash
+ (funcall hash (concat k_ipad text))))
+ 'iso-latin-1))))
(provide 'rfc2104)