From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/61117 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: Overriding valid charsets Date: Fri, 07 Oct 2005 20:29:59 +0200 Organization: Dept. of Theoretical Physics, University of Ulm Message-ID: Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1128710293 13390 80.91.229.2 (7 Oct 2005 18:38:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 7 Oct 2005 18:38:13 +0000 (UTC) Original-X-From: ding-owner+m9649@lists.math.uh.edu Fri Oct 07 20:38:08 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ENx6c-0001op-5r for ding-account@gmane.org; Fri, 07 Oct 2005 20:38:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1ENx6S-0002rR-00; Fri, 07 Oct 2005 13:37:56 -0500 Original-Received: from nas02.math.uh.edu ([129.7.128.40]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1ENx1F-0002rM-00 for ding@lists.math.uh.edu; Fri, 07 Oct 2005 13:32:33 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas02.math.uh.edu with esmtp (Exim 4.52) id 1ENx16-00040k-Ip for ding@lists.math.uh.edu; Fri, 07 Oct 2005 13:32:33 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1ENx15-0006Ri-00 for ; Fri, 07 Oct 2005 20:32:23 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1ENwzD-0007lx-PX for ding@gnus.org; Fri, 07 Oct 2005 20:30:27 +0200 Original-Received: from bridgekeeper.physik.uni-ulm.de ([134.60.10.123]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Oct 2005 20:30:27 +0200 Original-Received: from Reiner.Steib by bridgekeeper.physik.uni-ulm.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Oct 2005 20:30:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org Original-Lines: 74 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: bridgekeeper.physik.uni-ulm.de X-Face: P05mdcZT&lL[-s2=mw~RsllZ0zZAb?vdE}.s Hi, [ A question in gnu.emacs.help reminded me of an uncommitted patch in my work space. ] we already have a mechanism in Gnus to say "treat charset `windows-foo' as `iso-8859-1', if we don't have `windows-foo'": ,----[ v mm-charset-synonym-alist RET ] | mm-charset-synonym-alist is a variable defined in `mm-util'. | Its value is | ((big5-hkscs . big5) | (unicode . utf-16-le) | (ks_c_5601-1987 . cp949)) | | Documentation: | A mapping from invalid charset names to the real charset names. `---- But (to my knowledge) we don't have a mechanism to say "treat `iso-8859-1' as `windows-1252' even if `iso-8859-1' is a valid charset". `windows-1252' is a superset of `iso-8859-1' so this would not hurt for correctly labeled `iso-8859-1' postings, but it would display "labeled as `iso-8859-1', but in fact it's `windows-1252'" too. We also don't have "treat unlabeled (undecided) as `what-ever'". --8<---------------cut here---------------start------------->8--- --- mm-util.el 04 Oct 2005 17:16:17 +0200 7.36 +++ mm-util.el 07 Oct 2005 20:19:06 +0200 @@ -195,7 +195,24 @@ '((ks_c_5601-1987 . cp949)) '((ks_c_5601-1987 . euc-kr)))) ) - "A mapping from invalid charset names to the real charset names.") + "A mapping from unknown or invalid charset names to the real charset names.") + +(defcustom mm-charset-override-alist + `((iso-8859-1 . windows-1252)) + "A mapping from undesired charset names to their replacement. + +You may add pair like (iso-8859-1 . windows-1252) here, +i.e. treat iso-8859-1 as windows-1252. windows-1252 is a +superset of iso-8859-1." + :type '(list (set :inline t + (const (iso-8859-1 . windows-1252)) + (const (undecided . windows-1252))) + (repeat :inline t + :tag "Other options" + (cons (symbol :tag "From charset") + (symbol :tag "To charset")))) + :version "23.0" ;; No Gnus + :group 'mime) (defvar mm-binary-coding-system (cond @@ -436,6 +453,9 @@ ((or (null (mm-get-coding-system-list)) (not (fboundp 'coding-system-get))) charset) + ;; Check override list quite early: + ((let ((cs (cdr (assq charset mm-charset-override-alist)))) + (and cs (mm-coding-system-p cs) cs))) ;; ascii ((eq charset 'us-ascii) 'ascii) --8<---------------cut here---------------end--------------->8--- WDYT? Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/