unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6212: 23.2; ^S^Q^@ --error--> Wrong type argument: characterp, 67108896
@ 2010-05-18 15:10 Trent W. Buck
  2010-05-18 16:05 ` Juanma Barranquero
  2010-05-18 16:42 ` Chong Yidong
  0 siblings, 2 replies; 6+ messages in thread
From: Trent W. Buck @ 2010-05-18 15:10 UTC (permalink / raw)
  To: 6212

Attempting to insert a literal ^@ control character worked in 23.1.
In 23.2, it results in an error: Wrong type argument: characterp,
67108896

I am typing C-q C-SPC, in Emacs in Screen in linux's fbcon.  Since ^@ is
the zeroth character, perhaps this is an off-by-one or overflow error
somewhere.  The same error occurs when typing C-q C-@.

The use case is to find high-bit (non-ASCII) characters in a file of
indeterminate Windows codepage encoding.  I normally type C-M-s [^ C-q
C-SPC -~] (since ^@ and ~ are the bounds of the ASCII character set).
This no longer works.

In GNU Emacs 23.2.1 (x86_64-pc-linux-gnu)
 of 2010-05-16 on barber, modified by Debian
configured using `configure  '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.2/leim' '--with-x=no' '--without-gconf' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: C
  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_AU.utf8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  xterm-mouse-mode: t
  ido-everywhere: t
  savehist-mode: t
  icomplete-mode: t
  partial-completion-mode: t
  show-paren-mode: t
  delete-selection-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-s C-q C-@ ESC x r e p o r t SPC e m a c s SPC b u 
g RET

Recent messages:
Loading /etc/emacs/site-start.d/50haskell-mode.el (source)...
Loading /usr/share/emacs/site-lisp/haskell-mode/haskell-site-file.el (source)...done
Loading /etc/emacs/site-start.d/50haskell-mode.el (source)...done
Loading /etc/emacs/site-start.d/50paredit-el.el (source)...done
Loading /etc/emacs/site-start.d/50psvn.el (source)...done
Loading /etc/emacs/site-start.d/50puppet-el.el (source)...done
Loading /etc/emacs/site-start.d/50w3m-el-snapshot.el (source)...done
Loading /etc/emacs/site-start.d/51debian-el.el (source)...done
Ido mode enabled
For information about GNU Emacs and the GNU system, type C-h C-a.
isearch-process-search-char: Wrong type argument: characterp, 67108896

Load-path shadows:
/usr/share/emacs/site-lisp/haskell-mode/inf-haskell hides /usr/share/emacs/23.2/site-lisp/haskell-mode/inf-haskell
/usr/share/emacs/site-lisp/haskell-mode/haskell-site-file hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-site-file
/usr/share/emacs/site-lisp/haskell-mode/haskell-simple-indent hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-simple-indent
/usr/share/emacs/site-lisp/haskell-mode/haskell-mode hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-mode
/usr/share/emacs/site-lisp/haskell-mode/haskell-indentation hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-indentation
/usr/share/emacs/site-lisp/haskell-mode/haskell-indent hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-indent
/usr/share/emacs/site-lisp/haskell-mode/haskell-hugs hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-hugs
/usr/share/emacs/site-lisp/haskell-mode/haskell-ghci hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-ghci
/usr/share/emacs/site-lisp/haskell-mode/haskell-font-lock hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-font-lock
/usr/share/emacs/site-lisp/haskell-mode/haskell-doc hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-doc
/usr/share/emacs/site-lisp/haskell-mode/haskell-decl-scan hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-decl-scan
/usr/share/emacs/site-lisp/haskell-mode/haskell-cabal hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-cabal
/usr/share/emacs/site-lisp/haskell-mode/haskell-c hides /usr/share/emacs/23.2/site-lisp/haskell-mode/haskell-c
/usr/share/emacs/23.2/site-lisp/puppet-el/puppet-mode hides /usr/share/emacs/site-lisp/puppet-mode
/usr/share/emacs/23.2/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs23/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/23.2/lisp/textmodes/flyspell
/usr/share/emacs23/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/23.2/lisp/textmodes/ispell

Features:
(shadow sort mail-extr message sendmail regexp-opt ecomplete rfc822 mml
easymenu mml-sec password-cache mm-decode mm-bodies mm-encode mailcap
mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader
gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit
mailheader canlock sha1 hex-util hashcash mail-utils emacsbug
multi-isearch jka-compr edmacro kmacro xt-mouse ido savehist icomplete
complete paren delsel saveplace debian-el debian-el-loaddefs w3m-load
emacs-goodies-el emacs-goodies-custom emacs-goodies-loaddefs easy-mmode
dpkg-dev-el dpkg-dev-el-loaddefs ediff-hook vc-hooks lisp-float-type
lisp-mode register page menu-bar rfn-eshadow timer select mldrag mouse
jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
loaddefs button minibuffer faces cus-face files text-properties overlay
md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
multi-tty emacs)





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6212: 23.2; ^S^Q^@ --error--> Wrong type argument:  characterp, 67108896
  2010-05-18 15:10 bug#6212: 23.2; ^S^Q^@ --error--> Wrong type argument: characterp, 67108896 Trent W. Buck
@ 2010-05-18 16:05 ` Juanma Barranquero
  2010-05-18 16:42 ` Chong Yidong
  1 sibling, 0 replies; 6+ messages in thread
From: Juanma Barranquero @ 2010-05-18 16:05 UTC (permalink / raw)
  To: Trent W. Buck; +Cc: 6212

On Tue, May 18, 2010 at 17:10, Trent W. Buck <trentbuck@gmail.com> wrote:

> Attempting to insert a literal ^@ control character worked in 23.1.
> In 23.2, it results in an error: Wrong type argument: characterp,
> 67108896

`quoted-insert' is calling `read-quoted-char', which reads C-@ as the
character 0, but then does

  (lookup-key local-function-key-map (vector char))

`local-function-key-map' inherits from `function-key-map', which in
23.2 maps C-@ to C-SPC

  ;; Hitting C-SPC on text terminals, usually sends the ascii code 0 (aka C-@),
  ;; so we can't distinguish those two keys, but usually we consider C-SPC
  ;; (rather than C-@) as the "canonical" binding.
  (define-key function-key-map [?\C-@] [?\C-\s])

Presumably, by this change:

2009-10-19  Stefan Monnier  <monnier@iro.umontreal.ca>

	* bindings.el (function-key-map): Map C-@ to C-SPC if C-@ is unbound.

Stefan?

    Juanma





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6212: 23.2; ^S^Q^@ --error--> Wrong type argument: characterp, 67108896
  2010-05-18 15:10 bug#6212: 23.2; ^S^Q^@ --error--> Wrong type argument: characterp, 67108896 Trent W. Buck
  2010-05-18 16:05 ` Juanma Barranquero
@ 2010-05-18 16:42 ` Chong Yidong
  2010-05-18 20:32   ` Stefan Monnier
  1 sibling, 1 reply; 6+ messages in thread
From: Chong Yidong @ 2010-05-18 16:42 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Trent W. Buck, 6212

trentbuck@gmail.com (Trent W. Buck) writes:

> Attempting to insert a literal ^@ control character worked in 23.1.
> In 23.2, it results in an error: Wrong type argument: characterp,
> 67108896
>
> I am typing C-q C-SPC, in Emacs in Screen in linux's fbcon.  Since ^@ is
> the zeroth character, perhaps this is an off-by-one or overflow error
> somewhere.  The same error occurs when typing C-q C-@.

Yes, I can reproduce this on text-terminals.  It appears to be due to
the following change:

  2009-10-19  Stefan Monnier  <monnier@iro.umontreal.ca>

    * bindings.el (function-key-map): Map C-@ to C-SPC if C-@ is unbound.

which added the following to bindings.el:

  ;; Hitting C-SPC on text terminals, usually sends the ascii code 0 (aka C-@),
  ;; so we can't distinguish those two keys, but usually we consider C-SPC
  ;; (rather than C-@) as the "canonical" binding.
  (define-key function-key-map [?\C-@] [?\C-\s])

Stefan, could you take a look?  I don't know your original motivation
for this change, so I don't know how to fix it.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6212: 23.2; ^S^Q^@ --error--> Wrong type argument: characterp, 67108896
  2010-05-18 16:42 ` Chong Yidong
@ 2010-05-18 20:32   ` Stefan Monnier
  2010-05-18 20:52     ` Chong Yidong
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2010-05-18 20:32 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Trent W. Buck, 6212

>> Attempting to insert a literal ^@ control character worked in 23.1.
>> In 23.2, it results in an error: Wrong type argument: characterp,
>> 67108896
>> I am typing C-q C-SPC, in Emacs in Screen in linux's fbcon.  Since ^@ is
>> the zeroth character, perhaps this is an off-by-one or overflow error
>> somewhere.  The same error occurs when typing C-q C-@.
>     * bindings.el (function-key-map): Map C-@ to C-SPC if C-@ is unbound.
[...]
> Stefan, could you take a look?  I don't know your original motivation
> for this change, so I don't know how to fix it.

Indeed, that's part of the culprit.  The reason for the remapping is
that as the comment tries to explain many terminals send C-@ when the
user hits C-SPC, so rather than bind commands to both <prefix> C-SPC and
<prefix> C-@, it's much better to let key remapping handling it once and
for all.  The "canonical" binding is for C-SPC, so we want to remap C-@
to C-SPC rather than the other way around.

But note that C-q C-SPC works just fine, so the remapping from
C-@ to C-SPC is not really the core problem.

I think the patch I just installed (appended) will fix things.
Can you confirm?


        Stefan


=== modified file 'lisp/subr.el'
--- lisp/subr.el	2010-05-15 13:23:48 +0000
+++ lisp/subr.el	2010-05-18 20:25:28 +0000
@@ -1868,16 +1868,14 @@
 	(if inhibit-quit (setq quit-flag nil)))
       ;; Translate TAB key into control-I ASCII character, and so on.
       ;; Note: `read-char' does it using the `ascii-character' property.
-      ;; We could try and use read-key-sequence instead, but then C-q ESC
-      ;; or C-q C-x might not return immediately since ESC or C-x might be
-      ;; bound to some prefix in function-key-map or key-translation-map.
+      ;; We could try and use read-key instead.
+      (let ((translation (lookup-key local-function-key-map (vector char))))
+	(if (arrayp translation)
+	    (setq translated (aref translation 0))))
       (setq translated
 	    (if (integerp char)
 		(char-resolve-modifiers char)
 	      char))
-      (let ((translation (lookup-key local-function-key-map (vector char))))
-	(if (arrayp translation)
-	    (setq translated (aref translation 0))))
       (cond ((null translated))
 	    ((not (integerp translated))
 	     (setq unread-command-events (list char)






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6212: 23.2; ^S^Q^@ --error--> Wrong type argument: characterp, 67108896
  2010-05-18 20:32   ` Stefan Monnier
@ 2010-05-18 20:52     ` Chong Yidong
  2010-05-19  1:54       ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Chong Yidong @ 2010-05-18 20:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Trent W. Buck, 6212

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> Indeed, that's part of the culprit.  The reason for the remapping is
> that as the comment tries to explain many terminals send C-@ when the
> user hits C-SPC, so rather than bind commands to both <prefix> C-SPC and
> <prefix> C-@, it's much better to let key remapping handling it once and
> for all.  The "canonical" binding is for C-SPC, so we want to remap C-@
> to C-SPC rather than the other way around.
>
> But note that C-q C-SPC works just fine, so the remapping from
> C-@ to C-SPC is not really the core problem.
>
> I think the patch I just installed (appended) will fix things.
> Can you confirm?

Yes, it fixes the bug.  Thanks.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#6212: 23.2; ^S^Q^@ --error--> Wrong type argument: characterp, 67108896
  2010-05-18 20:52     ` Chong Yidong
@ 2010-05-19  1:54       ` Stefan Monnier
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2010-05-19  1:54 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Trent W. Buck

>> I think the patch I just installed (appended) will fix things.
>> Can you confirm?
> Yes, it fixes the bug.  Thanks.

Thanks, closed,


        Stefan





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-05-19  1:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-18 15:10 bug#6212: 23.2; ^S^Q^@ --error--> Wrong type argument: characterp, 67108896 Trent W. Buck
2010-05-18 16:05 ` Juanma Barranquero
2010-05-18 16:42 ` Chong Yidong
2010-05-18 20:32   ` Stefan Monnier
2010-05-18 20:52     ` Chong Yidong
2010-05-19  1:54       ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).