all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ehud Karni" <ehud@unix.mvs.co.il>
To: eliz@gnu.org
Cc: emacs-devel@gnu.org, handa@m17n.org
Subject: Re: Usage of standard-display-table in MSDOS
Date: Sun, 29 Aug 2010 16:06:42 +0300	[thread overview]
Message-ID: <201008291306.o7TD6gZ5007449@beta.mvs.co.il> (raw)
In-Reply-To: <201008291149.o7TBn3bO010199@beta.mvs.co.il> (message from Ehud Karni on Sun, 29 Aug 2010 14:49:03 +0300)

On Sun, 29 Aug 2010 14:49:03 Ehud Karni wrote:
>
> On Sun, 29 Aug 2010 07:21:26 Eli Zaretskii wrote:
> >
> > > From: "Ehud Karni" <ehud@unix.mvs.co.il>
> > >
> > > > ;; For NBSP (U+00A0)
> > > > (aset standard-display-table #xA0
> > > >       (vector (unibyte-char-to-multibyte #xA0)))
> > >
> > > The result in 21.3 is correct:
> > >     Byte: E0 (224),  Char: 0C60 (3168)
> > >
> > > But on 23.1 I get:
> > >     Byte: E0 (224),  Char: 3FFFE0 (4194272)
> > > i.e. "literal" #xE0.
> >
> > The last result is correct 0x3FFFE0 is the internal representation of
> > 0xE0 in Emacs 23.  Emacs 23 and later extends the Unicode code space
> > with these characters (and some others).
> >
> > Why did you think it was incorrect?
>
> Because of my coding system (iso-8859, remember ?) the #xE0 should be
> displayed as Aleph, not some 8 bit byte E0.

From another thread, I found Handa san suggestion to use `decode-char'.

So my my check function looks now like this:

(defun check-multibyte-code (byte)
       (message "Byte: %02X (%d),  M-Char: %04X (%d),  D-Char: %04X (%d)"
                byte byte
                (unibyte-char-to-multibyte byte)
                (unibyte-char-to-multibyte byte)
                (decode-char 'iso-8859-8 byte)
                (decode-char 'iso-8859-8 byte)))

It fails for Emacs-21.3 because `decode-char' returns nil.
For Emacs-23.1 the result is:
    Byte: E0 (224),  M-Char: 3FFFE0 (4194272),  D-Char 05D0 (1488)

So I can use `decode-char' in 23.1 and `unibyte-char-to-multibyte'
in 21.3 for building a display table.

Can you give the reasons to the changes in these functions ?

I think it is a bad practice to keep the function names while
changing how they work. It breaks tested code.

Ehud.


--
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7976-561  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D <http://www.keyserver.net/>    Better Safe Than Sorry



  reply	other threads:[~2010-08-29 13:06 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23 12:44 Usage of standard-display-table in MSDOS Kenichi Handa
2010-08-24  5:34 ` Stephen J. Turnbull
2010-08-24 11:13   ` Ehud Karni
2010-08-24 16:51     ` Eli Zaretskii
2010-08-25 13:04       ` Ehud Karni
2010-08-25 18:09         ` Eli Zaretskii
2010-08-26 15:26           ` Ehud Karni
2010-08-26 16:43             ` Eli Zaretskii
2010-08-27 13:35               ` Ehud Karni
2010-08-27 16:30                 ` Eli Zaretskii
2010-08-27 10:24 ` Eli Zaretskii
2010-08-27 11:44   ` Kenichi Handa
2010-08-27 14:13     ` Eli Zaretskii
2010-08-28  4:18       ` Kenichi Handa
2010-08-28  7:22         ` Eli Zaretskii
2010-08-30  2:24           ` Kenichi Handa
2010-08-30  3:02             ` Eli Zaretskii
2010-09-01  3:21             ` Kenichi Handa
2010-09-01  9:20               ` Ehud Karni
2010-09-01 23:33               ` Ehud Karni
2010-09-02  5:19                 ` Eli Zaretskii
2010-09-02  5:20                 ` Kenichi Handa
2010-09-04 22:54                   ` Ehud Karni
2010-09-06  1:30                     ` Kenichi Handa
2010-09-02 12:32                 ` Kenichi Handa
2010-09-04 23:32                   ` Ehud Karni
2010-09-05  5:30                     ` Eli Zaretskii
2010-09-06  5:14                     ` Kenichi Handa
2010-08-29 10:16         ` Ehud Karni
2010-08-29 11:21           ` Eli Zaretskii
2010-08-29 11:49             ` Ehud Karni
2010-08-29 13:06               ` Ehud Karni [this message]
2010-08-29 13:50                 ` Eli Zaretskii
2010-08-29 14:04               ` Eli Zaretskii
2010-09-07 21:11                 ` Ehud Karni
2010-09-09 11:57                   ` 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=201008291306.o7TD6gZ5007449@beta.mvs.co.il \
    --to=ehud@unix.mvs.co.il \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=handa@m17n.org \
    /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.