summaryrefslogtreecommitdiff
path: root/lisp/gnus
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/ChangeLog.unicode127
-rw-r--r--lisp/gnus/gnus-start.el8
-rw-r--r--lisp/gnus/message.el4
-rw-r--r--lisp/gnus/mm-bodies.el3
-rw-r--r--lisp/gnus/mm-util.el64
-rw-r--r--lisp/gnus/mml.el3
-rw-r--r--lisp/gnus/qp.el2
-rw-r--r--lisp/gnus/rfc2047.el2
-rw-r--r--lisp/gnus/rfc2104.el14
-rw-r--r--lisp/gnus/utf7.el4
10 files changed, 152 insertions, 79 deletions
diff --git a/lisp/gnus/ChangeLog.unicode b/lisp/gnus/ChangeLog.unicode
new file mode 100644
index 00000000000..4fcde1f3c09
--- /dev/null
+++ b/lisp/gnus/ChangeLog.unicode
@@ -0,0 +1,127 @@
+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 730406a2487..6038e93bbdf 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -457,6 +457,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.")
@@ -2361,8 +2363,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
@@ -2792,7 +2793,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 ";; -*- 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/message.el b/lisp/gnus/message.el
index d509b703419..931ac30e8a6 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -3589,8 +3589,8 @@ It should typically alter the sending method in some way or other."
(when (let ((char (char-after)))
(or (< (mm-char-int char) 128)
(and (mm-multibyte-p)
- ;; Fixme: Wrong for Emacs 22 and for things
- ;; like undecable utf-8. Should at least
+ ;; Fixme: Wrong for Emacs 23 and for things
+ ;; like undectable utf-8. Should at least
;; use find-coding-systems-region.
(memq (char-charset char)
'(eight-bit-control eight-bit-graphic
diff --git a/lisp/gnus/mm-bodies.el b/lisp/gnus/mm-bodies.el
index f58a840fbdd..3e9766c3d41 100644
--- a/lisp/gnus/mm-bodies.el
+++ b/lisp/gnus/mm-bodies.el
@@ -98,8 +98,7 @@ If no encoding was done, nil is returned."
(mm-encode-coding-region (point-min) (point-max) 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 a57389f59c4..988fd969425 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -340,7 +340,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 22
+ mime (or (coding-system-get cs :mime-charset) ; Emacs 23
(coding-system-get cs 'mime-charset)))
(when (and mime
(not (eq t (setq mule
@@ -349,36 +349,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)))
@@ -594,27 +564,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)
@@ -751,21 +700,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)))
charsets))
(defmacro mm-with-unibyte-buffer (&rest forms)
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 1f54754f98b..9721a054f06 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -213,8 +213,7 @@ one charsets.")
(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/qp.el b/lisp/gnus/qp.el
index d95508123ac..800f5090177 100644
--- a/lisp/gnus/qp.el
+++ b/lisp/gnus/qp.el
@@ -118,7 +118,7 @@ encode lines starting with \"From\"."
(not (eobp)))
(insert
(prog1
- ;; To unibyte in case of Emacs 22 eight-bit.
+ ;; To unibyte in case of Emacs 23 eight-bit.
(format "=%02X" (mm-multibyte-char-to-unibyte (char-after)))
(delete-char 1))))
;; Encode white space at the end of lines.
diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el
index ae2904c86fd..56f1758be22 100644
--- a/lisp/gnus/rfc2047.el
+++ b/lisp/gnus/rfc2047.el
@@ -288,7 +288,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 cea9f587ac9..43cdd3e44b3 100644
--- a/lisp/gnus/rfc2104.el
+++ b/lisp/gnus/rfc2104.el
@@ -51,6 +51,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:
@@ -86,12 +87,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)
@@ -108,9 +109,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)
diff --git a/lisp/gnus/utf7.el b/lisp/gnus/utf7.el
index 5207e96aeae..1ece50bf89a 100644
--- a/lisp/gnus/utf7.el
+++ b/lisp/gnus/utf7.el
@@ -1,5 +1,5 @@
;;; utf7.el --- UTF-7 encoding/decoding for Emacs -*-coding: iso-8859-1;-*-
-;; Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2003, 2005 Free Software Foundation, Inc.
;; Author: Jon K Hellan <hellan@acm.org>
;; Maintainer: bugs@gnus.org
@@ -78,7 +78,7 @@
(defconst utf7-utf-16-coding-system
(cond ((mm-coding-system-p 'utf-16-be-no-signature) ; Mule-UCS
'utf-16-be-no-signature)
- ((and (mm-coding-system-p 'utf-16-be) ; Emacs 22.1
+ ((and (mm-coding-system-p 'utf-16-be) ; Emacs 23.1
;; Avoid versions with BOM.
(= 2 (length (encode-coding-string "a" 'utf-16-be))))
'utf-16-be)