From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#10857: ucs-insert deals inconsistently with errors Date: Tue, 21 Feb 2012 02:37:38 +0200 Organization: JURTA Message-ID: <87obstt2n9.fsf@mail.jurta.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1329787020 22358 80.91.229.3 (21 Feb 2012 01:17:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 21 Feb 2012 01:17:00 +0000 (UTC) Cc: 10857@debbugs.gnu.org To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 21 02:16:59 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RzeLi-0005WB-8I for geb-bug-gnu-emacs@m.gmane.org; Tue, 21 Feb 2012 02:16:58 +0100 Original-Received: from localhost ([::1]:36992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzeLg-0000TD-E8 for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Feb 2012 20:16:56 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:45164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzeLd-0000Sr-7L for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2012 20:16:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzeLb-0005Nz-Kb for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2012 20:16:53 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44276) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzeLb-0005Np-Fh for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2012 20:16:51 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RzeNk-0008Ge-4q for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2012 20:19:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Feb 2012 01:19:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10857 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 10857-submit@debbugs.gnu.org id=B10857.132978709431669 (code B ref 10857); Tue, 21 Feb 2012 01:19:04 +0000 Original-Received: (at 10857) by debbugs.gnu.org; 21 Feb 2012 01:18:14 +0000 Original-Received: from localhost ([127.0.0.1]:47896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RzeMv-0008Eg-T4 for submit@debbugs.gnu.org; Mon, 20 Feb 2012 20:18:14 -0500 Original-Received: from ps18281.dreamhost.com ([69.163.218.105]:34124 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RzeMs-0008EQ-PA for 10857@debbugs.gnu.org; Mon, 20 Feb 2012 20:18:11 -0500 Original-Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 8152F451C898; Mon, 20 Feb 2012 17:14:23 -0800 (PST) In-Reply-To: (Juanma Barranquero's message of "Mon, 20 Feb 2012 16:53:56 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.93 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:57038 Archived-At: > 1) M-x ucs-insert zzz => "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. Wouldn't it be too weird for `read-char-by-name' to return "zzz" when the purpose of this function is to return a character, not a string the user typed. > 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)), In `read-char-by-name', the condition for this purpose is: (string-match-p "^[0-9a-fA-F]+$" input)