--- Begin Message ---
Subject: |
ucs-insert deals inconsistently with errors |
Date: |
Mon, 20 Feb 2012 16:53:56 +0100 |
Package: emacs
Severity: minor
`ucs-insert' does not deal very consistently with errors.
Two anomalies:
1) M-x ucs-insert <RET> zzz <RET> => "Not a Unicode character code: nil"
Which is caused by `read-char-by-name' not having a way to pass
back what the user really typed. Still, I typed "zzz", not "nil", so
the message is unhelpful.
2) When called from lisp code, it deals differently with erroneous
strings and erroneous non-strings:
(ucs-insert 'zzz) => "Not a Unicode character code: zzz" ;; correct
(ucs-insert "zzz") => any non-hex string is turned into ^@ and
inserted, and no error is produced.
The second problem can be trivially fixed with (not (string-match-p
"[^[:xdigit:]]" character)), though the docstring of `ucs-insert' does
not really say much about the valid forms the CHARACTER arg can take.
Juanma
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#10857: ucs-insert deals inconsistently with errors |
Date: |
Thu, 23 Feb 2012 01:35:30 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (x86_64-pc-linux-gnu) |
>> ((string-match-p "^#" input)
>
> This should also use \`.
All right, installed.
--- End Message ---