unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: 10857@debbugs.gnu.org
Subject: bug#10857: ucs-insert deals inconsistently with errors
Date: Mon, 20 Feb 2012 16:53:56 +0100	[thread overview]
Message-ID: <CAAeL0STxcxOHg2YSOpeDeCFbre+AzhGBoGRhtwGW1xaUc0zb4A@mail.gmail.com> (raw)

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





             reply	other threads:[~2012-02-20 15:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-20 15:53 Juanma Barranquero [this message]
2012-02-21  0:37 ` bug#10857: ucs-insert deals inconsistently with errors 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAeL0STxcxOHg2YSOpeDeCFbre+AzhGBoGRhtwGW1xaUc0zb4A@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=10857@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).