From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: 23.0.60; substitute-command-keys incorrect for self-insert-command Date: Tue, 19 Aug 2008 14:43:09 -0700 Message-ID: <00a601c90244$93099440$0200a8c0@us.oracle.com> References: <87tzdg3egu.fsf@cyd.mit.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1219182473 2343 80.91.229.12 (19 Aug 2008 21:47:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Aug 2008 21:47:53 +0000 (UTC) Cc: 240@emacsbugs.donarmstrong.com, emacs-devel@gnu.org To: "'Chong Yidong'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 19 23:48:46 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 1KVZ4E-0007cd-28 for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2008 23:48:42 +0200 Original-Received: from localhost ([127.0.0.1]:46943 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVZ3F-00025H-Sk for ged-emacs-devel@m.gmane.org; Tue, 19 Aug 2008 17:47:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KVZ3B-00023f-2z for emacs-devel@gnu.org; Tue, 19 Aug 2008 17:47:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KVZ39-00020x-Hv for emacs-devel@gnu.org; Tue, 19 Aug 2008 17:47:36 -0400 Original-Received: from [199.232.76.173] (port=53616 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVZ39-00020i-Ar for emacs-devel@gnu.org; Tue, 19 Aug 2008 17:47:35 -0400 Original-Received: from agminet01.oracle.com ([141.146.126.228]:24870) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KVZ38-0007pl-Cm for emacs-devel@gnu.org; Tue, 19 Aug 2008 17:47:35 -0400 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m7JLlGlg028659; Tue, 19 Aug 2008 16:47:16 -0500 Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m7JFBhOj001707; Tue, 19 Aug 2008 15:47:02 -0600 Original-Received: from inet-141-146-46-1.oracle.com by acsmt356.oracle.com with ESMTP id 11575288501219182147; Tue, 19 Aug 2008 14:42:27 -0700 Original-Received: from dradamslap1 (/141.144.102.127) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Aug 2008 14:42:26 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AckCPvBTYNT5cS2hRluADOkMixSy2wAAJYcA In-Reply-To: <87tzdg3egu.fsf@cyd.mit.edu> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:102688 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. 1. Yes, thanks. This treats the \200 and \377 the same way - both are single octal characters: (with-current-buffer "foo" (insert (substitute-command-keys (concat "\\{" "global-map" "}")))) 2. I'm using this in the *Help* buffer. The behavior of using octal chars here is new with Emacs 23, BTW. In Emacs 22, I see instead " .. y", where the first char looks like a space char and the y is really a y with an umlaut/diaresis/trema (two dots, at least). Dunno if the new behavior is intended or not. [I'm not sure those represent the same two character ranges, BTW, but in any case in Emacs 22 there are no octal chars from `substitute-command-keys'.]