From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: printing most-negative-fixnum fails Date: Tue, 11 May 2004 13:26:18 +0900 (JST) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200405110426.NAA06558@etlken.m17n.org> References: <200405062008.i46K8x4R015248@brains.moreideas.ca> <87r7trof5k.fsf-monnier+emacs@gnu.org> <200405110311.i4B3Bse22315@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1084250327 3974 80.91.224.253 (11 May 2004 04:38:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 May 2004 04:38:47 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs@whaite.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue May 11 06:38:36 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BNP2K-0001GP-00 for ; Tue, 11 May 2004 06:38:36 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BNP2I-0002im-00 for ; Tue, 11 May 2004 06:38:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BNOrM-00056d-Tc for emacs-devel@quimby.gnus.org; Tue, 11 May 2004 00:27:16 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BNOrI-00056J-DV for emacs-devel@gnu.org; Tue, 11 May 2004 00:27:12 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BNOqm-00052x-C8 for emacs-devel@gnu.org; Tue, 11 May 2004 00:27:11 -0400 Original-Received: from [192.47.44.130] (helo=tsukuba.m17n.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BNOql-00052c-My for emacs-devel@gnu.org; Tue, 11 May 2004 00:26:40 -0400 Original-Received: from fs.m17n.org (fs.m17n.org [192.47.44.2]) by tsukuba.m17n.org (8.11.6p2/8.11.6) with ESMTP id i4B4QJ817360; Tue, 11 May 2004 13:26:19 +0900 (JST) Original-Received: from etlken.m17n.org (etlken.m17n.org [192.47.44.125]) by fs.m17n.org (8.11.6p2/8.11.6) with ESMTP id i4B4QI924337; Tue, 11 May 2004 13:26:19 +0900 (JST) Original-Received: (from handa@localhost) by etlken.m17n.org (8.8.8+Sun/3.7W-2001040620) id NAA06558; Tue, 11 May 2004 13:26:18 +0900 (JST) Original-To: teirllm@dms.auburn.edu In-reply-to: <200405110311.i4B3Bse22315@raven.dms.auburn.edu> (message from Luc Teirlinck on Mon, 10 May 2004 22:11:54 -0500 (CDT)) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:23110 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23110 In article <200405110311.i4B3Bse22315@raven.dms.auburn.edu>, Luc Teirlinck writes: > Stefan Monnier wrote: > I can't reproduce your problem: I did >> emacs -q --no-site-file > most-negative-fixnum > C-x C-e > and it returned "-268435456 = ?\C-@". The right hand side of the return > value is indeed incorrect (that's a bug), but it's still not the problem > you're experiencing. > Could you give a recipe to reproduce your problem? > I can reproduce the problem. I do exactly what you did above and get: I can reproduce it simply by: (prin1-char most-negative-fixnum) The reason of this bug is that prin1-char checks if the arg CHAR is a valid character or not by: (char-valid-p (event-basic-type char)) and (event-basic-type most-negative-fixnum) returns 64. But I'm not sure at which level to fix it. I at first thought this will work: (char-valid-p (and (eventp char) (event-basic-type char))) But eventp returns non-nil for any integer. Isn't it a bug? Perhaps, eventp should be changed to something like this: (defsubst eventp (obj) "True if the argument is an event object." (or (and (integerp obj) (char-valid-p (logand obj (lognot (logior ?\M-\^@ ?\C-\^@ ?\S-\^@ ?\H-\^@ ?\s-\^@ ?\A-\^@))))) (and (symbolp obj) (get obj 'event-symbol-elements)) (and (consp obj) (symbolp (car obj)) (get (car obj) 'event-symbol-elements)))) --- Ken'ichi HANDA handa@m17n.org