aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2002-09-05 17:38:15 +0000
committerDave Love2002-09-05 17:38:15 +0000
commit0c129bca32a03adc6f12b088ba4132b52d5dcf94 (patch)
treebe0688dfe1186756be2441f950cfb6c88933afcb
parent0642c253368cfd9fccc8074535e5362271f641f1 (diff)
downloademacs-0c129bca32a03adc6f12b088ba4132b52d5dcf94.tar.gz
emacs-0c129bca32a03adc6f12b088ba4132b52d5dcf94.zip
(mm-hack-charsets, mm-iso-8859-15-compatible)
(mm-iso-8859-x-to-15-table): Deleted. (mm-find-mime-charset-region): Remove hack-charsets stuff.
-rw-r--r--lisp/gnus/mm-util.el42
1 files changed, 3 insertions, 39 deletions
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index c7866e8ca6c..783de0e5f2d 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -247,36 +247,6 @@
247 (coding-system-get cs 'safe-charsets)))))) 247 (coding-system-get cs 'safe-charsets))))))
248 (sort-coding-systems (coding-system-list 'base-only)))))) 248 (sort-coding-systems (coding-system-list 'base-only))))))
249 249
250(defvar mm-hack-charsets '(iso-8859-15 iso-2022-jp-2)
251 "A list of special charsets.
252Valid elements include:
253`iso-8859-15' convert ISO-8859-1, -9 to ISO-8859-15 if ISO-8859-15 exists.
254`iso-2022-jp-2' convert ISO-2022-jp to ISO-2022-jp-2 if ISO-2022-jp-2 exists."
255)
256
257(defvar mm-iso-8859-15-compatible
258 '((iso-8859-1 "\xA4\xA6\xA8\xB4\xB8\xBC\xBD\xBE")
259 (iso-8859-9 "\xA4\xA6\xA8\xB4\xB8\xBC\xBD\xBE\xD0\xDD\xDE\xF0\xFD\xFE"))
260 "ISO-8859-15 exchangeable coding systems and inconvertible characters.")
261
262(defvar mm-iso-8859-x-to-15-table
263 (and (fboundp 'coding-system-p)
264 (mm-coding-system-p 'iso-8859-15)
265 (mapcar
266 (lambda (cs)
267 (if (mm-coding-system-p (car cs))
268 (let ((c (string-to-char
269 (decode-coding-string "\341" (car cs)))))
270 (cons (char-charset c)
271 (cons
272 (- (string-to-char
273 (decode-coding-string "\341" 'iso-8859-15)) c)
274 (string-to-list (decode-coding-string (car (cdr cs))
275 (car cs))))))
276 '(gnus-charset 0)))
277 mm-iso-8859-15-compatible))
278 "A table of the difference character between ISO-8859-X and ISO-8859-15.")
279
280(defvar mm-coding-system-priorities nil 250(defvar mm-coding-system-priorities nil
281 "Preferred coding systems for encoding outgoing mails. 251 "Preferred coding systems for encoding outgoing mails.
282 252
@@ -485,7 +455,7 @@ If the charset is `composition', return the actual one."
485 (> (length (memq a mm-coding-system-priorities)) 455 (> (length (memq a mm-coding-system-priorities))
486 (length (memq b mm-coding-system-priorities)))) 456 (length (memq b mm-coding-system-priorities))))
487 457
488(defun mm-find-mime-charset-region (b e &optional hack-charsets) 458(defun mm-find-mime-charset-region (b e)
489 "Return the MIME charsets needed to encode the region between B and E. 459 "Return the MIME charsets needed to encode the region between B and E.
490nil means ASCII, a single-element list represents an appropriate MIME 460nil means ASCII, a single-element list represents an appropriate MIME
491charset, and a longer list means no appropriate charset." 461charset, and a longer list means no appropriate charset."
@@ -511,6 +481,8 @@ charset, and a longer list means no appropriate charset."
511 (setq systems nil 481 (setq systems nil
512 charsets (list cs)))))) 482 charsets (list cs))))))
513 charsets)) 483 charsets))
484 ;; Fixme: won't work for unibyte Emacs 22:
485
514 ;; Otherwise we're not multibyte, XEmacs or a single coding 486 ;; Otherwise we're not multibyte, XEmacs or a single coding
515 ;; system won't cover it. 487 ;; system won't cover it.
516 (setq charsets 488 (setq charsets
@@ -518,14 +490,6 @@ charset, and a longer list means no appropriate charset."
518 (mapcar 'mm-mime-charset 490 (mapcar 'mm-mime-charset
519 (delq 'ascii 491 (delq 'ascii
520 (mm-find-charset-region b e)))))) 492 (mm-find-charset-region b e))))))
521 (if (and (memq 'iso-8859-15 charsets)
522 (memq 'iso-8859-15 hack-charsets)
523 (save-excursion (mm-iso-8859-x-to-15-region b e)))
524 (mapcar (lambda (x) (setq charsets (delq (car x) charsets)))
525 mm-iso-8859-15-compatible))
526 (if (and (memq 'iso-2022-jp-2 charsets)
527 (memq 'iso-2022-jp-2 hack-charsets))
528 (setq charsets (delq 'iso-2022-jp charsets)))
529 charsets)) 493 charsets))
530 494
531(defmacro mm-with-unibyte-buffer (&rest forms) 495(defmacro mm-with-unibyte-buffer (&rest forms)