[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#10857: ucs-insert deals inconsistently with errors
From: |
Juanma Barranquero |
Subject: |
bug#10857: 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
- bug#10857: ucs-insert deals inconsistently with errors,
Juanma Barranquero <=