GNU bug report logs - #16677
24.3.50; Wrong type argument: char-or-string-p, 67108923

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Fri, 7 Feb 2014 02:58:02 UTC

Severity: minor

Found in version 24.3.50

Done: Juanma Barranquero <lekktu <at> gmail.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 16677 in the body.
You can then email your comments to 16677 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-gnu-emacs <at> gnu.org:
bug#16677; Package emacs. (Fri, 07 Feb 2014 02:58:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Drew Adams <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 07 Feb 2014 02:58:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; Wrong type argument: char-or-string-p, 67108923
Date: Thu, 6 Feb 2014 18:57:20 -0800 (PST)
emacs -Q

C-q C-;

Gives the cited error message.  It should give a more user
interface-level error, saying something to the effect that the key
sequence you used does not correspond to a character.

Note: in Emacs 20, this just inserts the escape character (^[), which is
wrong.  In Emacs 22, it just inserts the semicolon character (;), which
is also wrong.

Emacs 23 got it right, but it did not make the extra effort to give the
user an error message that s?he deserves: something more helpful than a
low-level barf message (even if that message might be comprehensible to
a knowledgable Emacs user).

Emacs can do better than that - this is, after all, a command, i.e.,
something that users use directly.

(I discovered this by accident, when my fingers slipped.)

In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2014-02-02 on ODIEONE
Bzr revision: 116242 rudalics <at> gmx.at-20140202130041-n967dw77nw7ztvy9
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/Devel/emacs/binary --enable-checking=yes,glyphs
 'CFLAGS=-O0 -g3' LDFLAGS=-Lc:/Devel/emacs/lib
 CPPFLAGS=-Ic:/Devel/emacs/include'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16677; Package emacs. (Fri, 07 Feb 2014 03:56:02 GMT) Full text and rfc822 format available.

Message #8 received at 16677 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 16677 <at> debbugs.gnu.org
Subject: Re: bug#16677: 24.3.50;
 Wrong type argument: char-or-string-p, 67108923
Date: Fri, 7 Feb 2014 04:55:04 +0100
On Fri, Feb 7, 2014 at 3:57 AM, Drew Adams <drew.adams <at> oracle.com> wrote:

> Emacs 23 got it right, but it did not make the extra effort to give the
> user an error message that s?he deserves: something more helpful than a
> low-level barf message (even if that message might be comprehensible to
> a knowledgable Emacs user).

It's not just an UI issue. If you type that in a buffer with binary
overwrite mode enabled, quoted-insert will delete a char and then
barf.

So I'd suggest this:

=== modified file 'lisp/simple.el'
--- lisp/simple.el 2014-02-07 03:22:34 +0000
+++ lisp/simple.el 2014-02-07 03:54:27 +0000
@@ -739,4 +739,7 @@
     ;;          (<= char ?\377))
     ;;     (setq char (unibyte-char-to-multibyte char)))
+    (unless (characterp char)
+      (user-error "%s is not a character"
+                  (help-key-description (vector char) nil)))
     (if (> arg 0)
  (if (eq overwrite-mode 'overwrite-mode-binary)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16677; Package emacs. (Fri, 07 Feb 2014 08:03:02 GMT) Full text and rfc822 format available.

Message #11 received at 16677 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: 16677 <at> debbugs.gnu.org, drew.adams <at> oracle.com
Subject: Re: bug#16677: 24.3.50;
 Wrong type argument: char-or-string-p, 67108923
Date: Fri, 07 Feb 2014 10:01:59 +0200
> From: Juanma Barranquero <lekktu <at> gmail.com>
> Date: Fri, 7 Feb 2014 04:55:04 +0100
> Cc: 16677 <at> debbugs.gnu.org
> 
> +    (unless (characterp char)
> +      (user-error "%s is not a character"
> +                  (help-key-description (vector char) nil)))

"%s is not a valid character" is a better error message, IMO.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16677; Package emacs. (Fri, 07 Feb 2014 10:53:02 GMT) Full text and rfc822 format available.

Message #14 received at 16677 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 16677 <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#16677: 24.3.50;
 Wrong type argument: char-or-string-p, 67108923
Date: Fri, 7 Feb 2014 11:52:10 +0100
On Fri, Feb 7, 2014 at 9:01 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> "%s is not a valid character" is a better error message, IMO.

You're right. Thanks.




Reply sent to Juanma Barranquero <lekktu <at> gmail.com>:
You have taken responsibility. (Fri, 07 Feb 2014 11:16:02 GMT) Full text and rfc822 format available.

Notification sent to Drew Adams <drew.adams <at> oracle.com>:
bug acknowledged by developer. (Fri, 07 Feb 2014 11:16:03 GMT) Full text and rfc822 format available.

Message #19 received at 16677-done <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 16677-done <at> debbugs.gnu.org, Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#16677: 24.3.50;
 Wrong type argument: char-or-string-p, 67108923
Date: Fri, 7 Feb 2014 12:15:04 +0100
Committed (using key-description instead of help-key-description).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16677; Package emacs. (Fri, 07 Feb 2014 17:03:04 GMT) Full text and rfc822 format available.

Message #22 received at 16677 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Juanma Barranquero <lekktu <at> gmail.com>
Cc: 16677 <at> debbugs.gnu.org
Subject: RE: bug#16677: 24.3.50; Wrong type argument: char-or-string-p,
 67108923
Date: Fri, 7 Feb 2014 09:02:43 -0800 (PST)
> > +    (unless (characterp char)
> > +      (user-error "%s is not a character"
> > +                  (help-key-description (vector char) nil)))
> 
> "%s is not a valid character" is a better error message, IMO.

Yes; thanks to both of you for such a fix.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16677; Package emacs. (Sat, 08 Feb 2014 10:22:02 GMT) Full text and rfc822 format available.

Message #25 received at 16677 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 16677 <at> debbugs.gnu.org,
 Drew Adams <drew.adams <at> oracle.com>
Subject: Re: bug#16677: 24.3.50;
 Wrong type argument: char-or-string-p, 67108923
Date: Sat, 08 Feb 2014 12:20:57 +0200
>> "%s is not a valid character" is a better error message, IMO.
>
> You're right. Thanks.

I installed the same change to `isearch-quote-char' as well.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 08 Mar 2014 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 62 days ago.

Previous Next


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