From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: "Trent W. Buck" <trentbuck@gmail.com>, 6212@debbugs.gnu.org
Subject: bug#6212: 23.2; ^S^Q^@ --error--> Wrong type argument: characterp, 67108896
Date: Tue, 18 May 2010 16:32:13 -0400 [thread overview]
Message-ID: <jwviq6lrmz2.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87pr0ti2k3.fsf@stupidchicken.com> (Chong Yidong's message of "Tue, 18 May 2010 12:42:52 -0400")
>> 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)
next prev parent reply other threads:[~2010-05-18 20:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2010-05-18 20:52 ` Chong Yidong
2010-05-19 1:54 ` Stefan Monnier
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=jwviq6lrmz2.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=6212@debbugs.gnu.org \
--cc=cyd@stupidchicken.com \
--cc=trentbuck@gmail.com \
/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.