* ucs-insert no longer working
@ 2013-04-14 20:49 Sven Bretfeld
2013-04-14 22:05 ` Drew Adams
0 siblings, 1 reply; 4+ messages in thread
From: Sven Bretfeld @ 2013-04-14 20:49 UTC (permalink / raw)
To: help-gnu-emacs
Hi to all
After today's update to Emacs 24.3.1 on Ubuntu 12.10 the following is no
longer working:
(defun insert-lang-a ()
(interactive)
(ucs-insert "0101"))
(global-set-key "\M-aa" 'insert-lang-a)
Debug-on-error gives:
Debugger entered--Lisp error: (wrong-type-argument characterp "0101")
insert-char("0101")
insert-lang-a()
call-interactively(insert-lang-a nil nil)
Replacing "ucs-insert" by "insert-char" doesn't help. Calling ucs-insert
manually with M-x works however. What strange bug is that?
Thanks for help,
Sven
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ucs-insert no longer working
[not found] <mailman.24120.1365972586.855.help-gnu-emacs@gnu.org>
@ 2013-04-14 21:25 ` Sven Joachim
2013-04-16 7:38 ` Sven Bretfeld
0 siblings, 1 reply; 4+ messages in thread
From: Sven Joachim @ 2013-04-14 21:25 UTC (permalink / raw)
To: help-gnu-emacs
On 2013-04-14 22:49 +0200, Sven Bretfeld wrote:
> After today's update to Emacs 24.3.1 on Ubuntu 12.10 the following is no
> longer working:
>
> (defun insert-lang-a ()
> (interactive)
> (ucs-insert "0101"))
> (global-set-key "\M-aa" 'insert-lang-a)
>
> Debug-on-error gives:
>
> Debugger entered--Lisp error: (wrong-type-argument characterp "0101")
> insert-char("0101")
> insert-lang-a()
> call-interactively(insert-lang-a nil nil)
>
> Replacing "ucs-insert" by "insert-char" doesn't help.
Obviously not, since the latter is just an alias to the former in Emacs
24.3.
> Calling ucs-insert
> manually with M-x works however. What strange bug is that?
I don't know if your syntax was ever supposed to work, but you should
use (ucs-insert #x0101) instead to make clear that it's a hexadecimal
code point you're inserting.
Cheers,
Sven
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: ucs-insert no longer working
2013-04-14 20:49 ucs-insert no longer working Sven Bretfeld
@ 2013-04-14 22:05 ` Drew Adams
0 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2013-04-14 22:05 UTC (permalink / raw)
To: 'Sven Bretfeld', help-gnu-emacs
> (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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ucs-insert no longer working
2013-04-14 21:25 ` Sven Joachim
@ 2013-04-16 7:38 ` Sven Bretfeld
0 siblings, 0 replies; 4+ messages in thread
From: Sven Bretfeld @ 2013-04-16 7:38 UTC (permalink / raw)
To: help-gnu-emacs
Sven Joachim <svenjoac@gmx.de> writes:
> On 2013-04-14 22:49 +0200, Sven Bretfeld wrote:
>
>> After today's update to Emacs 24.3.1 on Ubuntu 12.10 the following is no
>> longer working:
>>
>> (defun insert-lang-a ()
>> (interactive)
>> (ucs-insert "0101"))
>> (global-set-key "\M-aa" 'insert-lang-a)
>>
>> Debug-on-error gives:
>>
>> Debugger entered--Lisp error: (wrong-type-argument characterp "0101")
>> insert-char("0101")
>> insert-lang-a()
>> call-interactively(insert-lang-a nil nil)
>>
>> Replacing "ucs-insert" by "insert-char" doesn't help.
>
> Obviously not, since the latter is just an alias to the former in Emacs
> 24.3.
>
>> Calling ucs-insert
>> manually with M-x works however. What strange bug is that?
>
> I don't know if your syntax was ever supposed to work, but you should
> use (ucs-insert #x0101) instead to make clear that it's a hexadecimal
> code point you're inserting.
>
> Cheers,
> Sven
Hello
Strangely enough it was working for years. Also with Emacs 24. Only the
most recent update seemingly became intolerant to this mistake. Thank
you very much. Now its working again.
Sven
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-16 7:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-14 20:49 ucs-insert no longer working Sven Bretfeld
2013-04-14 22:05 ` Drew Adams
[not found] <mailman.24120.1365972586.855.help-gnu-emacs@gnu.org>
2013-04-14 21:25 ` Sven Joachim
2013-04-16 7:38 ` Sven Bretfeld
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.