GNU bug report logs - #240
23.0.60; substitute-command-keys incorrect for self-insert-command

Previous Next

Package: emacs;

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

Date: Wed, 14 May 2008 04:05:05 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


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

From: Chong Yidong <cyd <at> stupidchicken.com>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: emacs-devel <at> gnu.org, 240 <at> debbugs.gnu.org
Subject: Re: 23.0.60; substitute-command-keys incorrect for self-insert-command
Date: Tue, 19 Aug 2008 17:02:57 -0400
> emacs -Q
> In *scratch* buffer, type this, then use C-x C-e after it:
> (princ (substitute-command-keys "\\{global-map}") (current-buffer))
> 
> You will see this:
> 
> key             binding
> ---             -------
> 
> \200 .. \377 self-insert-command
> 
> The bug is that the \200 and the \377 are treated differently. The \200
> is a single octal character; the \377 is four characters, \, 3, 7, 7.

I believe this is simply how the Lisp printer behaves.  Note that
string_count_byte8 is zero for \200, but one for \377; hence \200 is
printed literally, while \377 is converted into an escaped string.

Using `insert' rather than `princ' probably gives the result you want.

I'm no expert on this area, though, so maybe someone else could comment
more authoritatively.




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

Previous Next


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