From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/56811 Path: main.gmane.org!not-for-mail From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de> Newsgroups: gmane.emacs.gnus.general Subject: Re: mm-coding-system-priorities Date: Wed, 24 Mar 2004 15:47:39 +0100 Organization: Dept. of Theoretical Physics, University of Ulm Sender: ding-owner@lists.math.uh.edu Message-ID: References: <878yhqz69f.fsf@tc-1-100.kawasaki.gol.ne.jp> Reply-To: Reiner Steib NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1080139704 22354 80.91.224.253 (24 Mar 2004 14:48:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 24 Mar 2004 14:48:24 +0000 (UTC) Original-X-From: ding-owner+M5350@lists.math.uh.edu Wed Mar 24 15:48:18 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1B69g1-0005Cw-00 for ; Wed, 24 Mar 2004 15:48:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1B69fi-0007Qv-00; Wed, 24 Mar 2004 08:47:58 -0600 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1B69fa-0007Qp-00 for ding@lists.math.uh.edu; Wed, 24 Mar 2004 08:47:50 -0600 Original-Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by justine.libertine.org (Postfix) with ESMTP id 22EB93A003F for ; Wed, 24 Mar 2004 08:47:50 -0600 (CST) Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1B69fZ-0002LD-00 for ; Wed, 24 Mar 2004 15:47:49 +0100 Original-Received: from lumberjack.physik.uni-ulm.de ([134.60.10.173]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Mar 2004 15:47:49 +0100 Original-Received: from reiner.steib by lumberjack.physik.uni-ulm.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Mar 2004 15:47:49 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org Original-Lines: 61 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: lumberjack.physik.uni-ulm.de X-Face: .*T0'iU(sujq_j9\J>-d4fg;N/1++U#U$_5ii6k.=|"-n'?5O:Hyz&wi'-!I~,}7~GgT=0S /&-R5sbkNy5+Xo1y{Tw2KKxi@Xh"g@]Qc|.U<*]WDd)qvGowFDvfU1F]{EDho:7P0@|oOD=Bc{K4?> WP68K[Mx:}=`ZT'6g4'f+g?;`vri2!)xGy}3:=l'(/Cea0l4lo^H5#@/Z3ev Mail-Copies-To: nobody User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:pDpUmpoFbsOiAwxEkTxJ3V7IoG8= Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:56811 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:56811 On Wed, Mar 24 2004, Miles Bader wrote: > I'm using the gnus in the Emacs source tree, so maybe this problem has > already been fixed: > > `mm-coding-system-priorities' seems to only work properly if the members > are `canonical' character-set names instead of aliases, I have fixed this (before 5.10.1 was released): ,---- | 2003-04-13 Reiner Steib | | * mm-util.el (mm-sort-coding-systems-predicate): Convert elements | of `mm-coding-system-priorities' to base coding system. `---- > It seems to me that gnus ought to do this mapping itself, as many coding > systems have aliases which are more widely used than their canonical emacs > names. I agree. > Perhaps something like (untested): > > --- orig/lisp/gnus/mm-util.el > +++ mod/lisp/gnus/mm-util.el > @@ -507,8 +507,11 @@ > ;; system that has one. > (let ((systems (find-coding-systems-region b e))) > (when mm-coding-system-priorities > - (setq systems > - (sort systems 'mm-sort-coding-systems-predicate))) > + (let ((mm-coding-system-priorities > + (mapcar #'coding-system-base > + mm-coding-system-priorities))) > + (setq systems > + (sort systems 'mm-sort-coding-systems-predicate)))) > ;; Fixme: The `mime-charset' (`x-ctext') of `compound-text' > ;; is not in the IANA list. > (setq systems (delq 'compound-text systems)) I've done it in `mm-sort-coding-systems-predicate' (but I don't remember exactly why I did it in this way). If you think that your solution is better, we may change it. (defun mm-sort-coding-systems-predicate (a b) (let ((priorities (mapcar (lambda (cs) ;; Note: invalid entries are dropped silently (and (coding-system-p cs) (coding-system-base cs))) mm-coding-system-priorities))) (> (length (memq a priorities)) (length (memq b priorities))))) Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- PGP key available via WWW http://rsteib.home.pages.de/