From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: 23.0.60; substitute-command-keys incorrect for self-insert-command Date: Tue, 19 Aug 2008 17:02:57 -0400 Message-ID: <87tzdg3egu.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1219179861 25610 80.91.229.12 (19 Aug 2008 21:04:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Aug 2008 21:04:21 +0000 (UTC) Cc: 240@emacsbugs.donarmstrong.com, emacs-devel@gnu.org To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 19 23:05:10 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KVYNX-0000op-UQ for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2008 23:04:36 +0200 Original-Received: from localhost ([127.0.0.1]:43659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVYMa-00018S-69 for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2008 17:03:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KVYKy-0000Lq-I3 for emacs-devel@gnu.org; Tue, 19 Aug 2008 17:01:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KVYKw-0000LA-O3 for emacs-devel@gnu.org; Tue, 19 Aug 2008 17:01:55 -0400 Original-Received: from [199.232.76.173] (port=36811 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVYKw-0000L7-HJ for emacs-devel@gnu.org; Tue, 19 Aug 2008 17:01:54 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]:45573) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KVYKv-0003kb-R6 for emacs-devel@gnu.org; Tue, 19 Aug 2008 17:01:54 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id DD70F57E339; Tue, 19 Aug 2008 17:02:57 -0400 (EDT) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:102685 Archived-At: > 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.