From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.bugs Subject: bug#1042: 23.0.60; read-char can evaluate to non-character Date: Sun, 28 Sep 2008 14:14:55 +0200 Message-ID: References: <20080928050936.D9027B0F76E@mt-computer.local> <48DF4544.2070704@gmx.at> Reply-To: Markus Triska , 1042@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1222605012 26562 80.91.229.12 (28 Sep 2008 12:30:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Sep 2008 12:30:12 +0000 (UTC) Cc: 1042@emacsbugs.donarmstrong.com To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 28 14:31:09 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KjvQb-0008Ay-7c for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Sep 2008 14:31:09 +0200 Original-Received: from localhost ([127.0.0.1]:58995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjvPY-0003Oc-EN for geb-bug-gnu-emacs@m.gmane.org; Sun, 28 Sep 2008 08:30:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KjvPT-0003O0-Dh for bug-gnu-emacs@gnu.org; Sun, 28 Sep 2008 08:29:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KjvPS-0003Mn-02 for bug-gnu-emacs@gnu.org; Sun, 28 Sep 2008 08:29:58 -0400 Original-Received: from [199.232.76.173] (port=40588 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KjvPR-0003Mg-Rz for bug-gnu-emacs@gnu.org; Sun, 28 Sep 2008 08:29:57 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:51451) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KjvPR-0005y7-5w for bug-gnu-emacs@gnu.org; Sun, 28 Sep 2008 08:29:57 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8SCTt69010237; Sun, 28 Sep 2008 05:29:55 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m8SCK2ED007927; Sun, 28 Sep 2008 05:20:02 -0700 X-Loop: don@donarmstrong.com Resent-From: Markus Triska Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sun, 28 Sep 2008 12:20:02 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1042 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1042-submit@emacsbugs.donarmstrong.com id=B1042.12226041127299 (code B ref 1042); Sun, 28 Sep 2008 12:20:02 +0000 Original-Received: (at 1042) by emacsbugs.donarmstrong.com; 28 Sep 2008 12:15:12 +0000 Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m8SCF6TP006689 for <1042@emacsbugs.donarmstrong.com>; Sun, 28 Sep 2008 05:15:08 -0700 Original-Received: (qmail invoked by alias); 28 Sep 2008 12:15:01 -0000 Original-Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp052) with SMTP; 28 Sep 2008 14:15:01 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX1/R4e5TqL3RCfdWMg/FzqMHXuLtB0FQ0hlw0I9nJ8 WmEPUKaQYZe+W+ Original-Received: by mt-computer.local (Postfix, from userid 502) id 4CA0FB0F8CE; Sun, 28 Sep 2008 14:14:56 +0200 (CEST) In-Reply-To: <48DF4544.2070704@gmx.at> (martin rudalics's message of "Sun, 28 Sep 2008 10:50:12 +0200") X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6899999999999999 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sun, 28 Sep 2008 08:29:58 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:20853 Archived-At: martin rudalics writes: > The doc-string of `read-char' says C-SPC (= 0) is different from C-0: (characterp 0) is t, and (char-to-string 0) evaluates to a string; i.e., it is a character. > Do you have a particular use case that calls for throwing an error > here? I relied on `read-char' evaluating to a character in ediprolog: http://www.logic.at/prolog/ediprolog/ediprolog.html On l.352, I read a character from the user and use `char-to-string' to send it to the Prolog process as string. If the user generates an event that is not a character, it should not be sent to the Prolog process, and a usage note is displayed instead. Thus, I can work around the current behaviour of `read-char' by also guarding `char-to-string' against errors, or using the now obsolete `char-valid-p' for Emacs 22, and `characterp' for later versions. However, it would be nice if `read-char' always yielded a character.