From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.bugs Subject: bug#10857: ucs-insert deals inconsistently with errors Date: Mon, 20 Feb 2012 16:53:56 +0100 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1329753370 24705 80.91.229.3 (20 Feb 2012 15:56:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 20 Feb 2012 15:56:10 +0000 (UTC) To: 10857@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 20 16:56:09 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 1RzVay-0000qo-7J for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Feb 2012 16:56:08 +0100 Original-Received: from localhost ([::1]:35191 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzVax-0007rD-Nc for geb-bug-gnu-emacs@m.gmane.org; Mon, 20 Feb 2012 10:56:07 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:44413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzVan-0007jA-SV for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2012 10:56:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzVah-0005BP-8H for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2012 10:55:57 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzVag-0005BL-UI for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2012 10:55:51 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RzVcn-0002VA-QX for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2012 10:58:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juanma Barranquero Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Feb 2012 15:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 10857 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: Bug-Gnu-Emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.13297534299550 (code B ref -1); Mon, 20 Feb 2012 15:58:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Feb 2012 15:57:09 +0000 Original-Received: from localhost ([127.0.0.1]:47572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RzVbw-0002Ty-QB for submit@debbugs.gnu.org; Mon, 20 Feb 2012 10:57:09 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:58270) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RzVbs-0002TS-RQ for submit@debbugs.gnu.org; Mon, 20 Feb 2012 10:57:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzVZc-0004ts-60 for submit@debbugs.gnu.org; Mon, 20 Feb 2012 10:54:48 -0500 Original-Received: from lists.gnu.org ([140.186.70.17]:44185) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzVZc-0004tk-4V for submit@debbugs.gnu.org; Mon, 20 Feb 2012 10:54:44 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:44103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzVZW-0006p0-Gj for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2012 10:54:44 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzVZV-0004t3-J6 for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2012 10:54:38 -0500 Original-Received: from mail-pz0-f41.google.com ([209.85.210.41]:51194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzVZV-0004sz-74 for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2012 10:54:37 -0500 Original-Received: by dadv6 with SMTP id v6so6175434dad.0 for ; Mon, 20 Feb 2012 07:54:36 -0800 (PST) Received-SPF: pass (google.com: domain of lekktu@gmail.com designates 10.68.130.233 as permitted sender) client-ip=10.68.130.233; Authentication-Results: mr.google.com; spf=pass (google.com: domain of lekktu@gmail.com designates 10.68.130.233 as permitted sender) smtp.mail=lekktu@gmail.com; dkim=pass header.i=lekktu@gmail.com Original-Received: from mr.google.com ([10.68.130.233]) by 10.68.130.233 with SMTP id oh9mr64484706pbb.92.1329753276221 (num_hops = 1); Mon, 20 Feb 2012 07:54:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=D5iPi1lB9H+pM2VQV7t6g/pPrelcYbaobFILC+tV2oE=; b=DTQIaqaND2xoo7ajEO4kQKG8xpFu6TjNCk7ZNjHqEGASqRu1x2hC6npHkD+NMYqfp0 Sr4IHNWOh/VtyYz0uTergD1iSVxxIgj5iYJiwrdCLzj4YDBgVel0pm73+hnYAyM1jvxg kZrvc4HOKw8FLOaKQKpkVait8mXhegNmqDJn0= Original-Received: by 10.68.130.233 with SMTP id oh9mr53323889pbb.92.1329753276165; Mon, 20 Feb 2012 07:54:36 -0800 (PST) Original-Received: by 10.143.37.9 with HTTP; Mon, 20 Feb 2012 07:53:56 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:57027 Archived-At: Package: emacs Severity: minor `ucs-insert' does not deal very consistently with errors. Two anomalies: 1) M-x ucs-insert zzz =3D> "Not a Unicode character code: ni= l" 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) =3D> "Not a Unicode character code: zzz" ;; corre= ct (ucs-insert "zzz") =3D> 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. =C2=A0 =C2=A0 Juanma