From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#6212: 23.2; ^S^Q^@ --error--> Wrong type argument: characterp, 67108896 Date: Tue, 18 May 2010 16:32:13 -0400 Message-ID: References: <87632lutyf.fsf@gmail.com> <87pr0ti2k3.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1274219412 24973 80.91.229.12 (18 May 2010 21:50:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 18 May 2010 21:50:12 +0000 (UTC) Cc: "Trent W. Buck" , 6212@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 18 23:50:11 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OEUfw-0002sT-Nc for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 May 2010 23:50:09 +0200 Original-Received: from localhost ([127.0.0.1]:60221 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEUfw-0008MB-8T for geb-bug-gnu-emacs@m.gmane.org; Tue, 18 May 2010 17:50:08 -0400 Original-Received: from [140.186.70.92] (port=38797 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEUfr-0008M6-HP for bug-gnu-emacs@gnu.org; Tue, 18 May 2010 17:50:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OETqS-00080J-TD for bug-gnu-emacs@gnu.org; Tue, 18 May 2010 16:56:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53580) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OETqP-0007zy-OY for bug-gnu-emacs@gnu.org; Tue, 18 May 2010 16:56:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OETTJ-0003VG-NX; Tue, 18 May 2010 16:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 May 2010 20:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6212 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6212-submit@debbugs.gnu.org id=B6212.127421474113457 (code B ref 6212); Tue, 18 May 2010 20:33:01 +0000 Original-Received: (at 6212) by debbugs.gnu.org; 18 May 2010 20:32:21 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OETSf-0003V0-Hb for submit@debbugs.gnu.org; Tue, 18 May 2010 16:32:21 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OETSc-0003Uu-Lp for 6212@debbugs.gnu.org; Tue, 18 May 2010 16:32:19 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhIFAKaV8ktMCpz0/2dsb2JhbACXV4Yscr8BhRAEjC8 X-IronPort-AV: E=Sophos;i="4.53,257,1272859200"; d="scan'208";a="64510536" Original-Received: from 76-10-156-244.dsl.teksavvy.com (HELO pastel.home) ([76.10.156.244]) by ironport2-out.pppoe.ca with ESMTP; 18 May 2010 16:32:13 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id AF0578079; Tue, 18 May 2010 16:32:13 -0400 (EDT) In-Reply-To: <87pr0ti2k3.fsf@stupidchicken.com> (Chong Yidong's message of "Tue, 18 May 2010 12:42:52 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 18 May 2010 16:33:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37026 Archived-At: >> 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 C-SPC and 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)