diff options
| author | Dave Love | 2002-05-14 15:38:31 +0000 |
|---|---|---|
| committer | Dave Love | 2002-05-14 15:38:31 +0000 |
| commit | 956e4f3624d5e587bf1d74fb41e20a6a2515c758 (patch) | |
| tree | f13995b962be9ab0261b76ddc7d0697bff7de969 | |
| parent | 3724c60036499a8b5a5ffe2b47dea0a8fab3ee71 (diff) | |
| download | emacs-956e4f3624d5e587bf1d74fb41e20a6a2515c758.tar.gz emacs-956e4f3624d5e587bf1d74fb41e20a6a2515c758.zip | |
(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'.
| -rw-r--r-- | lisp/gnus/mm-util.el | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el index bbc16c04879..385d09f09e7 100644 --- a/lisp/gnus/mm-util.el +++ b/lisp/gnus/mm-util.el | |||
| @@ -24,7 +24,9 @@ | |||
| 24 | 24 | ||
| 25 | ;;; Code: | 25 | ;;; Code: |
| 26 | 26 | ||
| 27 | (eval-when-compile (require 'cl)) | 27 | (eval-when-compile |
| 28 | (require 'cl) | ||
| 29 | (defvar mm-mime-mule-charset-alist)) | ||
| 28 | (require 'mail-prsvr) | 30 | (require 'mail-prsvr) |
| 29 | 31 | ||
| 30 | (eval-and-compile | 32 | (eval-and-compile |
| @@ -231,9 +233,11 @@ | |||
| 231 | 'nconc | 233 | 'nconc |
| 232 | (mapcar | 234 | (mapcar |
| 233 | (lambda (cs) | 235 | (lambda (cs) |
| 234 | (when (and (coding-system-get cs 'mime-charset) | 236 | (when (and (or (coding-system-get cs :mime-charset) ; Emacs 22 |
| 237 | (coding-system-get cs 'mime-charset)) | ||
| 235 | (not (eq t (coding-system-get cs 'safe-charsets)))) | 238 | (not (eq t (coding-system-get cs 'safe-charsets)))) |
| 236 | (list (cons (coding-system-get cs 'mime-charset) | 239 | (list (cons (or (coding-system-get cs :mime-charset) |
| 240 | (coding-system-get cs 'mime-charset)) | ||
| 237 | (delq 'ascii | 241 | (delq 'ascii |
| 238 | (coding-system-get cs 'safe-charsets)))))) | 242 | (coding-system-get cs 'safe-charsets)))))) |
| 239 | (sort-coding-systems (coding-system-list 'base-only)))))) | 243 | (sort-coding-systems (coding-system-list 'base-only)))))) |
| @@ -296,7 +300,8 @@ prefer iso-2022-jp to japanese-shift-jis: | |||
| 296 | (dolist (cs (find-coding-systems-for-charsets (list charset))) | 300 | (dolist (cs (find-coding-systems-for-charsets (list charset))) |
| 297 | (unless mime | 301 | (unless mime |
| 298 | (when cs | 302 | (when cs |
| 299 | (setq mime (coding-system-get cs 'mime-charset))))) | 303 | (setq mime (or (coding-system-get cs :mime-charset) |
| 304 | (coding-system-get cs 'mime-charset)))))) | ||
| 300 | mime) | 305 | mime) |
| 301 | (let ((alist mm-mime-mule-charset-alist) | 306 | (let ((alist mm-mime-mule-charset-alist) |
| 302 | out) | 307 | out) |
| @@ -345,7 +350,8 @@ used as the line break code type of the coding system." | |||
| 345 | ;; Do we need -lbt? | 350 | ;; Do we need -lbt? |
| 346 | (dolist (c (mm-get-coding-system-list)) | 351 | (dolist (c (mm-get-coding-system-list)) |
| 347 | (if (and (null cs) | 352 | (if (and (null cs) |
| 348 | (eq charset (coding-system-get c 'mime-charset))) | 353 | (eq charset (or (coding-system-get c :mime-charset) |
| 354 | (coding-system-get c 'mime-charset)))) | ||
| 349 | (setq cs c))) | 355 | (setq cs c))) |
| 350 | cs)))) | 356 | cs)))) |
| 351 | 357 | ||
| @@ -440,8 +446,10 @@ If the charset is `composition', return the actual one." | |||
| 440 | ;; This exists in Emacs 20. | 446 | ;; This exists in Emacs 20. |
| 441 | (or | 447 | (or |
| 442 | (and (mm-preferred-coding-system charset) | 448 | (and (mm-preferred-coding-system charset) |
| 443 | (coding-system-get | 449 | (or (coding-system-get |
| 444 | (mm-preferred-coding-system charset) 'mime-charset)) | 450 | (mm-preferred-coding-system charset) :mime-charset) |
| 451 | (coding-system-get | ||
| 452 | (mm-preferred-coding-system charset) 'mime-charset))) | ||
| 445 | (and (eq charset 'ascii) | 453 | (and (eq charset 'ascii) |
| 446 | 'us-ascii) | 454 | 'us-ascii) |
| 447 | (mm-preferred-coding-system charset) | 455 | (mm-preferred-coding-system charset) |
| @@ -510,7 +518,9 @@ charset, and a longer list means no appropriate charset." | |||
| 510 | (setq systems (delq 'compound-text systems)) | 518 | (setq systems (delq 'compound-text systems)) |
| 511 | (unless (equal systems '(undecided)) | 519 | (unless (equal systems '(undecided)) |
| 512 | (while systems | 520 | (while systems |
| 513 | (let ((cs (coding-system-get (pop systems) 'mime-charset))) | 521 | (let ((cs (or (coding-system-get (pop systems) |
| 522 | :mime-charset) | ||
| 523 | (coding-system-get systems 'mime-charset)))) | ||
| 514 | (if cs | 524 | (if cs |
| 515 | (setq systems nil | 525 | (setq systems nil |
| 516 | charsets (list cs)))))) | 526 | charsets (list cs)))))) |