aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/gnus/ChangeLog4
-rw-r--r--lisp/gnus/mm-util.el56
2 files changed, 32 insertions, 28 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index f33f5a38acf..76df7a1409d 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,7 @@
12011-06-30 Glenn Morris <rgm@gnu.org>
2
3 * mm-util.el (mm-charset-synonym-alist): Move definition before use.
4
12011-06-30 Lars Magne Ingebrigtsen <larsi@gnus.org> 52011-06-30 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 6
3 * mm-util.el (mm-charset-to-coding-system): Recognise all ANSI.x3.4 7 * mm-util.el (mm-charset-to-coding-system): Recognise all ANSI.x3.4
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 08f23aaf282..d57b61dac83 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -300,34 +300,6 @@ system object in XEmacs."
300 ;; no-MULE XEmacs: 300 ;; no-MULE XEmacs:
301 (car (memq cs (mm-get-coding-system-list)))))) 301 (car (memq cs (mm-get-coding-system-list))))))
302 302
303(defun mm-codepage-setup (number &optional alias)
304 "Create a coding system cpNUMBER.
305The coding system is created using `codepage-setup'. If ALIAS is
306non-nil, an alias is created and added to
307`mm-charset-synonym-alist'. If ALIAS is a string, it's used as
308the alias. Else windows-NUMBER is used."
309 (interactive
310 (let ((completion-ignore-case t)
311 (candidates (if (fboundp 'cp-supported-codepages)
312 (cp-supported-codepages)
313 ;; Removed in Emacs 23 (unicode), so signal an error:
314 (error "`codepage-setup' not present in this Emacs version"))))
315 (list (gnus-completing-read "Setup DOS Codepage" candidates
316 t nil nil "437"))))
317 (when alias
318 (setq alias (if (stringp alias)
319 (intern alias)
320 (intern (format "windows-%s" number)))))
321 (let* ((cp (intern (format "cp%s" number))))
322 (unless (mm-coding-system-p cp)
323 (if (fboundp 'codepage-setup) ; silence compiler
324 (codepage-setup number)
325 (error "`codepage-setup' not present in this Emacs version")))
326 (when (and alias
327 ;; Don't add alias if setup of cp failed.
328 (mm-coding-system-p cp))
329 (add-to-list 'mm-charset-synonym-alist (cons alias cp)))))
330
331(defvar mm-charset-synonym-alist 303(defvar mm-charset-synonym-alist
332 `( 304 `(
333 ;; Not in XEmacs, but it's not a proper MIME charset anyhow. 305 ;; Not in XEmacs, but it's not a proper MIME charset anyhow.
@@ -376,6 +348,34 @@ the alias. Else windows-NUMBER is used."
376 348
377See `mm-codepage-iso-8859-list' and `mm-codepage-ibm-list'.") 349See `mm-codepage-iso-8859-list' and `mm-codepage-ibm-list'.")
378 350
351(defun mm-codepage-setup (number &optional alias)
352 "Create a coding system cpNUMBER.
353The coding system is created using `codepage-setup'. If ALIAS is
354non-nil, an alias is created and added to
355`mm-charset-synonym-alist'. If ALIAS is a string, it's used as
356the alias. Else windows-NUMBER is used."
357 (interactive
358 (let ((completion-ignore-case t)
359 (candidates (if (fboundp 'cp-supported-codepages)
360 (cp-supported-codepages)
361 ;; Removed in Emacs 23 (unicode), so signal an error:
362 (error "`codepage-setup' not present in this Emacs version"))))
363 (list (gnus-completing-read "Setup DOS Codepage" candidates
364 t nil nil "437"))))
365 (when alias
366 (setq alias (if (stringp alias)
367 (intern alias)
368 (intern (format "windows-%s" number)))))
369 (let* ((cp (intern (format "cp%s" number))))
370 (unless (mm-coding-system-p cp)
371 (if (fboundp 'codepage-setup) ; silence compiler
372 (codepage-setup number)
373 (error "`codepage-setup' not present in this Emacs version")))
374 (when (and alias
375 ;; Don't add alias if setup of cp failed.
376 (mm-coding-system-p cp))
377 (add-to-list 'mm-charset-synonym-alist (cons alias cp)))))
378
379(defcustom mm-codepage-iso-8859-list 379(defcustom mm-codepage-iso-8859-list
380 (list 1250 ;; Windows-1250 is a variant of Latin-2 heavily used by Microsoft 380 (list 1250 ;; Windows-1250 is a variant of Latin-2 heavily used by Microsoft
381 ;; Outlook users in Czech republic. Use this to allow reading of 381 ;; Outlook users in Czech republic. Use this to allow reading of