MULE rant...
Aidan Kehoe
kehoea at parhasard.net
Sat Aug 28 12:23:31 EDT 2004
Ar an t-ochtú lá is fiche de mí Lúnasa, scríobh David Kastrup:
> [... much complaining about Mule-UCS.]
>
> I have a Unicode character number and want the corresponding XEmacs
> string. That is all for now. I am prepared that the menu display
> will probably be wrong. But users can configure it on or off, and
> they can complain when something wrong appears and perhaps you care
> more when they complain instead of myself. But if I don't even get
> told how to convert the Unicode code point into a simple 1-byte
> string, I can't even get this process started.
This should work in 21.4 and 21.5. 21.4 Mule-UCS _is_ broken, hackish, and
unsupported, though--it will probably save you a lot of headaches if you
just state that you don't support it for this.
;; More verbose than it needs to be, because it's checking its first
;; argument, which won't be anything other than 'ucs for current code in the
;; wild.
(unless (fboundp 'decode-char)
(cond ((fboundp 'unicode-to-char)
(defmacro decode-char (quote-ucs code)
`(prog2 (assert (eq (quote ucs) ,quote-ucs))
(unicode-to-char ,code))))
((and (locate-library "un-define")
(require 'un-define))
(defmacro decode-char (quote-ucs code)
`(prog2 (assert (eq (quote ucs) ,quote-ucs))
(unicode-to-char ,code))))))
XEmacs uses unicode-to-char and/or ucs-to-char there. (Myself, I'm a
little unclear as to the utility of generalising that function beyond
Unicode; make-char would seem to do the job for any other large character
sets that actually exist in the world.)
--
Like the early Christians, Marx expected the millennium very soon; like
their successors, his have been disappointed--once more, the world has shown
itself recalcitrant to a tidy formula embodying the hopes of some section of
mankind. (Russell)
More information about the XEmacs-Beta
mailing list