help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: ucs-insert no longer working


From: Drew Adams
Subject: RE: ucs-insert no longer working
Date: Sun, 14 Apr 2013 15:05:59 -0700

> (ucs-insert "0101")
>
> (wrong-type-argument characterp "0101")
> 
> Calling ucs-insert manually with M-x works however.
> What strange bug is that?

It's not a bug.  When you call the command interactively you are prompted for
input and the command interprets that input.  In this case it interprets your
input of 0101 as a hex code for a character.

But after that interactive dialong is finished, what is passed to the command
body is the character.  And a character in Emacs Lisp is an integer (only
certain integers are chars, however).

The command requires a character as its argument.  "0101" is not a character.
It is not even a non-character integer.  It is a string.

Try (ucs-insert ?\x0101) and you will see the difference.

Consult the Elisp manual, node `Strings and Characters', and its subnodes.




reply via email to

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