all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: monnier@iro.umontreal.ca, emacs@whaite.ca, emacs-devel@gnu.org
Subject: Re: printing most-negative-fixnum fails
Date: Tue, 11 May 2004 13:26:18 +0900 (JST)	[thread overview]
Message-ID: <200405110426.NAA06558@etlken.m17n.org> (raw)
In-Reply-To: <200405110311.i4B3Bse22315@raven.dms.auburn.edu> (message from Luc Teirlinck on Mon, 10 May 2004 22:11:54 -0500 (CDT))

In article <200405110311.i4B3Bse22315@raven.dms.auburn.edu>, Luc Teirlinck <teirllm@dms.auburn.edu> 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

      reply	other threads:[~2004-05-11  4:26 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-06 20:08 printing most-negative-fixnum fails Peter Whaite
2004-05-11  0:17 ` Juri Linkov
2004-05-11  3:20   ` Stefan Monnier
2004-05-11 16:57     ` Juri Linkov
2004-05-12 19:41       ` Richard Stallman
2004-05-11 12:23   ` Richard Stallman
2004-05-11 16:47     ` Juri Linkov
2004-05-14  9:20       ` Richard Stallman
2004-05-14 11:46         ` Kenichi Handa
2004-05-15  8:17           ` Juri Linkov
2004-05-15  8:53           ` Richard Stallman
2004-05-15  9:19             ` David Kastrup
2004-05-15 20:03             ` Juri Linkov
2004-05-18 13:03               ` Kenichi Handa
2004-05-19  8:36           ` Juri Linkov
2004-05-15  8:09         ` Juri Linkov
2004-05-15 18:34           ` Richard Stallman
2004-05-15 19:32             ` Juri Linkov
2004-05-12  1:41     ` Kenichi Handa
2004-05-12  2:06       ` Stefan Monnier
2004-05-12  4:43         ` Kenichi Handa
2004-05-11  2:48 ` Stefan Monnier
2004-05-11  3:11   ` Luc Teirlinck
2004-05-11  4:26     ` Kenichi Handa [this message]

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

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

  git send-email \
    --in-reply-to=200405110426.NAA06558@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    --cc=emacs@whaite.ca \
    --cc=monnier@iro.umontreal.ca \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.