all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
Subject: Strange results from sort-coding-systems
Date: Tue, 21 Mar 2006 21:50:55 +0100	[thread overview]
Message-ID: <v9d5gfo72o.fsf@marauder.physik.uni-ulm.de> (raw)

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>

             reply	other threads:[~2006-03-21 20:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-21 20:50 Reiner Steib [this message]
2006-03-21 22:03 ` Strange results from sort-coding-systems Stefan Monnier
2006-03-22 16:58   ` Kevin Rodgers
2006-03-23  1:21     ` Kenichi Handa

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=v9d5gfo72o.fsf@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.