From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#3907: bad result for insert-kbd-macro Date: Thu, 23 Jul 2009 17:55:00 -0400 Message-ID: References: Reply-To: Stefan Monnier , 3907@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248400683 10631 80.91.229.12 (24 Jul 2009 01:58:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 24 Jul 2009 01:58:03 +0000 (UTC) Cc: 3907@emacsbugs.donarmstrong.com To: Francesco Potorti` Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 24 03:57:55 2009 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 1MUA2k-0006Vz-1x for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Jul 2009 03:57:54 +0200 Original-Received: from localhost ([127.0.0.1]:60579 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MUA2j-0000Zz-KT for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Jul 2009 21:57:53 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MUA2U-0000SP-0t for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2009 21:57:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MUA2P-0000RC-EO for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2009 21:57:37 -0400 Original-Received: from [199.232.76.173] (port=50303 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MUA2P-0000Qv-0B for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2009 21:57:33 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:43369) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MUA2O-0006d5-9L for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2009 21:57:32 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6O1vUtS011343; Thu, 23 Jul 2009 18:57:30 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n6O1e50t008487; Thu, 23 Jul 2009 18:40:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 24 Jul 2009 01:40:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3907 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3907-submit@emacsbugs.donarmstrong.com id=B3907.12483992877669 (code B ref 3907); Fri, 24 Jul 2009 01:40:04 +0000 Original-Received: (at 3907) by emacsbugs.donarmstrong.com; 24 Jul 2009 01:34:47 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.teksavvy.com (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6O1YhIJ007662 for <3907@emacsbugs.donarmstrong.com>; Thu, 23 Jul 2009 18:34:44 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuQFAN+saEpMCrRU/2dsb2JhbABEgQ3PP4QNBYcL X-IronPort-AV: E=Sophos;i="4.43,259,1246852800"; d="scan'208";a="42084871" Original-Received: from 76-10-180-84.dsl.teksavvy.com (HELO ceviche.home) ([76.10.180.84]) by ironport2-out.teksavvy.com with ESMTP; 23 Jul 2009 21:34:37 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 7CA66B41EA; Thu, 23 Jul 2009 17:55:00 -0400 (EDT) In-Reply-To: (Francesco Potorti`'s message of "Thu, 23 Jul 2009 18:04:46 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 23 Jul 2009 21:57:37 -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:29602 Archived-At: > I created a macro and called insert-kbd-macro on it. This is the > result: > (fset 'allegati > [?e ?\C-[ ?< ?\C-s ?t ?e ?x ?t ?/ ?h ?t ?m ?l ?\C-m ?\C-[ ?{ ?\C-[ ?{ ?\C-[ ?} ?\C-x ?q ?\C-[ ?x ?k ?e ?e ?p ?\C-m ?f ?i ?l ?e ?n ?a ?m ?e ?= ?\C-m ?\C-m ?\C-m ?\C-[ ?% ?. ?* ?f ?i ?l ?e ?n ?a ?m ?e ?= ?\" ?\\ ?( ?[ ?^ ?\" ?] ?+ ?\\ ?) ?\" ?\C-m ? ?[ ? ?\\ ?1 ? ?] ?\C-m ?! ?\C-m ?\C-m ?\C-m ?\C-x ?q ?\C-c ?\C-c ?o ?\C-[ ?\C-? ?i ?s ?i ?\C-m ?\C-[ ?p ? ?d ?\C-[ ?> up ?\C-c ?\C-c ?\C-m]) > 1) first, if I go to the end of the macro and hit C-x C-e, it appears > that the sexp is not correctly evaluated, as the parser sees > unbalanced parentheses This is a bug in the emacs-lisp-mode, mostly. But indeed, the printer should also be more careful to escape the chars that cause problem for the emacs-lisp-mode (i.e. print ?\[ rather than ?[ in your above example). This said, IIUC the printer used in Emacs-23 does pay attention this problem and insert-kbd-macro gave me (for example): (setq last-kbd-macro [?a left ?\[]) so the problem seems to be fixed in Emacs-23. Can you confirm? > 2) second, insert-kbd-macro used to write the strings between double > quotes, which is generally more readable and allows for easy editing; > I do not know wht it used the vector style here There's an `up' symbol in there, which couldn't fit in a string. In general an event is not a char any more (it used to be, back in the tty days when bytes and chars were the same thing), so a sequence of events should preferably always be represented as an array of events, rather than as a string (although, insert-kbd-macro still appears to use a string when possible). Stefan