From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.devel Subject: Strange results from sort-coding-systems Date: Tue, 21 Mar 2006 21:50:55 +0100 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 1142974340 18480 80.91.229.2 (21 Mar 2006 20:52:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Mar 2006 20:52:20 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 21 21:52:19 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FLnpu-0001Eh-3A for ged-emacs-devel@m.gmane.org; Tue, 21 Mar 2006 21:52:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FLnq3-0007EN-H3 for ged-emacs-devel@m.gmane.org; Tue, 21 Mar 2006 15:52:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FLnpo-0007DV-CS for emacs-devel@gnu.org; Tue, 21 Mar 2006 15:52:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FLnpk-0007CG-Fd for emacs-devel@gnu.org; Tue, 21 Mar 2006 15:52:04 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FLnpk-0007CB-AU for emacs-devel@gnu.org; Tue, 21 Mar 2006 15:52:04 -0500 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FLnpn-00014e-EA for emacs-devel@gnu.org; Tue, 21 Mar 2006 15:52:07 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FLnp6-00014e-8e for emacs-devel@gnu.org; Tue, 21 Mar 2006 21:51:24 +0100 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 ; Tue, 21 Mar 2006 21:51:24 +0100 Original-Received: from Reiner.Steib by bridgekeeper.physik.uni-ulm.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 21 Mar 2006 21:51:24 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-To: emacs-devel@gnu.org Original-Lines: 133 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: bridgekeeper.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.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:ysXwxDDBYsSCS5j7+jmmYAEEXq4= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:51941 Archived-At: Hi, the function `rs-sort-coding-systems-21-3-fix-p'[1,2], should return t iff mule-utf-8 is not preferred over mule-utf-16-be and mule-utf-16-le: (defun rs-sort-coding-systems-21-3-fix-p () "Return non-nil iff we need to use `rs-sort-coding-systems'." (let ((pref (car (sort-coding-systems '(mule-utf-16-be mule-utf-16-le mule-utf-8))))) (message "pref=%s" pref) (not (eq 'mule-utf-8 pref)))) When I call it the first time, it returns nil with current CVS Emacs. But the second time, I get `t'. See the *ielm* buffer and the *Messages* buffer below. Am I doing something wrong? Bye, Reiner. --8<---------------cut here---------------start------------->8--- *** Welcome to IELM *** Type (describe-mode) for help. ELISP> emacs-version "22.0.50.6" ELISP> (emacs-version) "GNU Emacs 22.0.50.6 (i686-pc-linux-gnu, GTK+ Version 2.4.9)\n of 2006-03-21 on shrubbery" ELISP> (defun rs-sort-coding-systems-21-3-fix-p () "Return non-nil iff we need to use `rs-sort-coding-systems'." (let ((pref (car (sort-coding-systems '(mule-utf-16-be mule-utf-16-le mule-utf-8))))) (message "pref=%s" pref) (not (eq 'mule-utf-8 pref)))) rs-sort-coding-systems-21-3-fix-p ELISP> (rs-sort-coding-systems-21-3-fix-p) nil ELISP> (rs-sort-coding-systems-21-3-fix-p) t ELISP> (rs-sort-coding-systems-21-3-fix-p) t ELISP> (rs-sort-coding-systems-21-3-fix-p) t ELISP> (rs-sort-coding-systems-21-3-fix-p) t ELISP> (rs-sort-coding-systems-21-3-fix-p) t ELISP> (rs-sort-coding-systems-21-3-fix-p) t ELISP> (rs-sort-coding-systems-21-3-fix-p) t ELISP> (car (sort-coding-systems '(mule-utf-16-be mule-utf-16-le mule-utf-8))) mule-utf-8 ELISP> (car (sort-coding-systems '(mule-utf-16-be mule-utf-16-le mule-utf-8))) mule-utf-8 ELISP> (rs-sort-coding-systems-21-3-fix-p) t --8<---------------cut here---------------end--------------->8--- >>From the *Messages* buffer: --8<---------------cut here---------------start------------->8--- pref=mule-utf-8 History item: 1 pref=mule-utf-16-be History item: 1 pref=mule-utf-16-be History item: 1 pref=mule-utf-16-be History item: 1 pref=mule-utf-16-be History item: 1 pref=mule-utf-16-be History item: 1 pref=mule-utf-16-be History item: 1 pref=mule-utf-16-be Mark set [2 times] History item: 1 [2 times] History item: 2 History item: 3 pref=mule-utf-16-be --8<---------------cut here---------------end--------------->8--- >>From `M-x report-emacs-bug RET': --8<---------------cut here---------------start------------->8--- In GNU Emacs 22.0.50.6 (i686-pc-linux-gnu, GTK+ Version 2.4.9) of 2006-03-21 on shrubbery X server distributor `The X.Org Foundation', version 11.0.60801000 configured using `configure '--prefix=/import/xtra/emacs/HEAD' '--with-gtk' '--exec-prefix=/import/xtra/emacs/HEAD-i686'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: POSIX value of $LC_CTYPE: de_DE@euro value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US locale-coding-system: iso-8859-15 default-enable-multibyte-characters: t Major mode: IELM Minor modes in effect: tooltip-mode: t auto-compression-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t line-number-mode: t transient-mark-mode: identity --8<---------------cut here---------------end--------------->8--- [1] | Emacs 21.3 and Emacs 21.4 come with a slightly broken version of | the function `sort-coding-systems'. Therefore in some cases, Gnus | uses utf-16-x rather than utf-8. Additionally, it's not correct | utf-16-be. See http://thread.gmane.org/gmane.emacs.bugs/4663 or | http://article.gmane.org/gmane.emacs.bugs/4673 for details. [2] | Based on a suggestion by Stefan Monnier in | http://thread.gmane.org/gmane.emacs.devel/13662 | Message-ID: <200305031842.h43IgBDm025358@rum.cs.yale.edu>