From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#240: 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__46199.6602862657$1219183735$gmane$org@us.oracle.com> References: <87tzdg3egu.fsf@cyd.mit.edu> Reply-To: Drew Adams , 240@emacsbugs.donarmstrong.com 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 1219183677 6356 80.91.229.12 (19 Aug 2008 22:07:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Aug 2008 22:07:57 +0000 (UTC) Cc: 240@emacsbugs.donarmstrong.com, emacs-devel@gnu.org To: "'Chong Yidong'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 20 00:08:49 2008 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.50) id 1KVZNW-0005oV-N5 for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Aug 2008 00:08:39 +0200 Original-Received: from localhost ([127.0.0.1]:47207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVZMY-0006yi-Gk for geb-bug-gnu-emacs@m.gmane.org; Tue, 19 Aug 2008 18:07:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KVZMV-0006y7-7R for bug-gnu-emacs@gnu.org; Tue, 19 Aug 2008 18:07:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KVZMT-0006uC-H5 for bug-gnu-emacs@gnu.org; Tue, 19 Aug 2008 18:07:34 -0400 Original-Received: from [199.232.76.173] (port=42668 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KVZMT-0006u1-EE for bug-gnu-emacs@gnu.org; Tue, 19 Aug 2008 18:07:33 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:37123) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KVZMS-0004jP-CN for bug-gnu-emacs@gnu.org; Tue, 19 Aug 2008 18:07:33 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7JM7QTW029234; Tue, 19 Aug 2008 15:07:27 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m7JLt5cx024306; Tue, 19 Aug 2008 14:55:05 -0700 X-Loop: don@donarmstrong.com Resent-From: "Drew Adams" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 19 Aug 2008 21:55:05 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 240 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 240-submit@emacsbugs.donarmstrong.com id=B240.121918244722461 (code B ref 240); Tue, 19 Aug 2008 21:55:05 +0000 Original-Received: (at 240) by emacsbugs.donarmstrong.com; 19 Aug 2008 21:47:27 +0000 Original-Received: from agminet01.oracle.com (agminet01.oracle.com [141.146.126.228]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m7JLlNt6022454 for <240@emacsbugs.donarmstrong.com>; Tue, 19 Aug 2008 14:47:24 -0700 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.6 (newer, 3) Resent-Date: Tue, 19 Aug 2008 18:07:34 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:19545 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'.]