Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de>
Subject: Re: mm-coding-system-priorities
Date: Wed, 24 Mar 2004 15:47:39 +0100	[thread overview]
Message-ID: <v9k71ab8tw.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <878yhqz69f.fsf@tc-1-100.kawasaki.gol.ne.jp>

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  <Reiner.Steib@gmx.de>
| 
| 	* 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/




  parent reply	other threads:[~2004-03-24 14:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-24 14:09 mm-coding-system-priorities Miles Bader
2004-03-24 14:28 ` mm-coding-system-priorities Jesper Harder
2004-03-24 14:47 ` Reiner Steib [this message]
2004-03-24 15:06   ` mm-coding-system-priorities Miles Bader
  -- strict thread matches above, loose matches on Subject: below --
2003-03-07 17:39 charset=macintosh Karl Eichwalder
2003-03-07 18:25 ` charset=macintosh Simon Josefsson
2003-04-01 17:51   ` mm-coding-system-priorities (was: charset=macintosh) Reiner Steib
2003-04-12 19:53     ` mm-coding-system-priorities Lars Magne Ingebrigtsen
2003-04-13 20:44       ` mm-coding-system-priorities Reiner Steib
2003-04-15 21:54         ` mm-coding-system-priorities Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v9k71ab8tw.fsf@marauder.physik.uni-ulm.de \
    --to=4.uce.03.r.s@nurfuerspam.de \
    --cc=reiner.steib@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).