Kyle Jones <kyle_jones(a)wonderworks.com> writes:
Hrvoje Niksic writes:
> This adds a `make-char' function to non-Mule XEmacsen for partial
> compatibility with Mule.
I don't see the value of this in a non-MULE XEmacs.
make-char is the only portable interface for creating arbitrary
characters.
As such, it's useful in non-Mule XEmacsen for European uses. For
example, I had old code that looked up Croatian characters in a table
and inserted them in the buffer (I used it, and still use it, to
emulate different keyboard styles.) The code basically looked like
this:
(let ((char ...look up...))
;; CHAR is an 8bit value
(self-insert-internal char))
Now, with Mule you need to convert the number to an actual Latin 2
character. The way to do it is using make-char, so now I have a
function that looks like this:
(defun latin2-convert (chr)
(if (and (> chr 128)
(featurep 'mule))
(make-char 'latin-iso8859-2 (- chr 128))
chr))
"make-char update", part 1, served to get rid of the 128 subtraction.
With this new update, you can get rid of the featurep check and write
the code like this:
(defun latin2-convert (chr)
(make-char (if (> chr 128) 'latin-iso8859-2 'ascii)
chr))
This will do the expected thing with or without Mule. The same goes
for (make-char 'ascii 65), etc. This is what I meant by "partial
compatibility with Mule".
This has all been hashed out between me, Olivier Galibert, and other
subscribers on the Mule list, which I invite you to subscribe.