GNU bug report logs - #638
23.0.60; read-char evaluates to unexpected non-character value

Previous Next

Package: emacs;

Reported by: Markus Triska <markus.triska <at> gmx.at>

Date: Fri, 1 Aug 2008 12:05:06 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 638 in the body.
You can then email your comments to 638 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#638; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Markus Triska <markus.triska <at> gmx.at>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Markus Triska <markus.triska <at> gmx.at>
To: emacs-pretest-bug <at> gnu.org
Subject: 23.0.60; read-char evaluates to unexpected non-character value
Date: Fri, 01 Aug 2008 13:55:22 +0200
When I do:

   $ emacs -Q --eval "(insert (format \"%s\" (read-char nil nil 0.1))))"

The content of *scratch* is:

   7340161

whereas it is "nil" in Emacs 22.2.

In GNU Emacs 23.0.60.3 (i386-apple-darwin8.11.1, GTK+ Version 2.12.9)
 of 2008-07-25 on pnsgw3-client030.demo.tuwien.ac.at
Windowing system distributor `The XFree86 Project, Inc', version 11.0.40400000
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t




Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#638; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Lawrence Mitchell <wence <at> gmx.li>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #10 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Lawrence Mitchell <wence <at> gmx.li>
To: emacs-pretest-bug <at> gnu.org
Cc: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#638: 23.0.60; read-char evaluates to unexpected non-character value
Date: Fri, 01 Aug 2008 13:49:35 +0100
Markus Triska wrote:
> When I do:

>    $ emacs -Q --eval "(insert (format \"%s\" (read-char nil nil 0.1))))"

> The content of *scratch* is:

>    7340161

This is due to the following change:

2008-03-05  Kenichi Handa  <handa <at> ni.aist.go.jp>

	* lread.c (Fread_char): Resolve modifiers.
	(Fread_char_exclusive): Likewise.

It unconditionally resolves modifiers even if read_filtered_event
returns nil.  The following patch fixes things, I think.

2008-08-01  Lawrence Mitchell  <wence <at> gmx.li>

	* lread.c (Fread_char, Fread_char_exclusive): If no character
	event is read before timeout is reached, return nil, rather than
	converting to a number.


diff --git a/src/lread.c b/src/lread.c
index f36162b..97b22d5 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -796,6 +796,8 @@ floating-point value.  */)
   if (! NILP (prompt))
     message_with_string ("%s", prompt, 0);
   val = read_filtered_event (1, 1, 1, ! NILP (inherit_input_method), seconds);
+  if ( NILP (val) )
+    return Qnil;
   c = XINT (val);
   return make_number (char_resolve_modifier_mask (c));
 }
@@ -841,6 +843,8 @@ floating-point value.  */)
   if (! NILP (prompt))
     message_with_string ("%s", prompt, 0);
   val = read_filtered_event (1, 1, 0, ! NILP (inherit_input_method), seconds);
+  if ( NILP (val) )
+    return Qnil;
   c = XINT (val);
   return make_number (char_resolve_modifier_mask (c));
 }
-- 
1.5.6.GIT



-- 
Lawrence Mitchell <wence <at> gmx.li>





Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#638; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Lawrence Mitchell <wence <at> gmx.li>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Markus Triska <markus.triska <at> gmx.at>:
bug acknowledged by developer. Full text and rfc822 format available.

Message #20 received at 638-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Lawrence Mitchell <wence <at> gmx.li>
Cc: 638-done <at> debbugs.gnu.org
Subject: Re: 23.0.60; read-char evaluates to unexpected non-character value
Date: Thu, 14 Aug 2008 15:27:19 -0400
Lawrence Mitchell wrote:

> > When I do:
> >
> >    $ emacs -Q --eval "(insert (format \"%s\" (read-char nil nil 0.1))))"
> >
> > The content of *scratch* is:
> >
> >    7340161
>
> This is due to the following change:
>
> 2008-03-05  Kenichi Handa  <handa <at> ni.aist.go.jp>
>
> 	* lread.c (Fread_char): Resolve modifiers.
> 	(Fread_char_exclusive): Likewise.
>
> It unconditionally resolves modifiers even if read_filtered_event
> returns nil.  The following patch fixes things, I think.

I've checked your patch into CVS.  Thanks for debugging and fixing this.




bug archived. Request was from Debbugs Internal Request <don <at> donarmstrong.com> to internal_control <at> emacsbugs.donarmstrong.com. (Fri, 12 Sep 2008 14:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 335 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.