unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10857: ucs-insert deals inconsistently with errors
@ 2012-02-20 15:53 Juanma Barranquero
  2012-02-21  0:37 ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Juanma Barranquero @ 2012-02-20 15:53 UTC (permalink / raw)
  To: 10857

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





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-02-22 23:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-20 15:53 bug#10857: ucs-insert deals inconsistently with errors Juanma Barranquero
2012-02-21  0:37 ` Juri Linkov
2012-02-21  1:25   ` Juanma Barranquero
2012-02-21  9:16     ` Andreas Schwab
2012-02-21 10:39       ` Juanma Barranquero
2012-02-22  0:09     ` Juri Linkov
2012-02-22  9:03       ` Andreas Schwab
2012-02-22 23:35         ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).