emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strange results from sort-coding-systems


From: Reiner Steib
Subject: Strange results from sort-coding-systems
Date: Tue, 21 Mar 2006 21:50:55 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

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: address@hidden
  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: <address@hidden>






reply via email to

[Prev in Thread] Current Thread [Next in Thread]