From unknown Wed Jun 18 00:14:23 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#3907 <3907@debbugs.gnu.org> To: bug#3907 <3907@debbugs.gnu.org> Subject: Status: bad result for insert-kbd-macro Reply-To: bug#3907 <3907@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:14:23 +0000 retitle 3907 bad result for insert-kbd-macro reassign 3907 emacs submitter 3907 Francesco Potorti` severity 3907 normal thanks From pot@gnu.org Thu Jul 23 09:06:04 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 23 Jul 2009 16:06:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=AWL,FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6NG5xEv006333 for ; Thu, 23 Jul 2009 09:06:00 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MU0nu-0006zF-GI for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2009 12:05:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MU0np-0006s2-Fk for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2009 12:05:57 -0400 Received: from [199.232.76.173] (port=54156 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MU0np-0006rn-AH for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2009 12:05:53 -0400 Received: from mx4.isti.cnr.it ([194.119.192.6]:60380 helo=ITANIUM.ISTI.CNR.IT) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MU0no-00050E-EA for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2009 12:05:52 -0400 Received: from conversionlocal.isti.cnr.it by mx.isti.cnr.it (PMDF V6.4 #31598) id <01NBO24NN2A88ZE6TH@mx.isti.cnr.it> for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2009 18:04:45 +0200 (MEST) Received: from tucano.isti.cnr.it (tucano.isti.cnr.it [146.48.81.102]) by mx.isti.cnr.it (PMDF V6.4 #31599) with ESMTPSA id <01NBO24NHYBG95MNJT@mx.isti.cnr.it> for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2009 18:04:45 +0200 Received: from pot by tucano.isti.cnr.it with local (Exim 4.69) (envelope-from ) id 1MU0mk-0007w9-75 for bug-gnu-emacs@gnu.org; Thu, 23 Jul 2009 18:04:46 +0200 Date: Thu, 23 Jul 2009 18:04:46 +0200 From: Francesco Potorti` Subject: bad result for insert-kbd-macro To: bug-gnu-emacs@gnu.org Message-id: Organization: X-INSM-ip-source: 146.48.81.102 Auth Done X-fingerprint: 4B02 6187 5C03 D6B1 2E31 7666 09DF 2DC9 BE21 6115 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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]) I see two problems here: 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 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 In GNU Emacs 22.3.1 (x86_64-pc-linux-gnu, GTK+ Version 2.16.4) of 2009-07-03 on nautilus, modified by Debian configured using `configure '--build=x86_64-linux-gnu' '--host=x86_64-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs22:/etc/emacs:/usr/local/share/emacs/22.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/22.3/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/22.3/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: C value of $LC_COLLATE: it_IT@euro value of $LC_CTYPE: it_IT@euro value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: C value of $LC_TIME: nil value of $LANG: nil locale-coding-system: nil default-enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: desktop-save-mode: t openwith-mode: t display-time-mode: t shell-dirtrack-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t abbrev-mode: t Recent input: a SPC d e t t a g l i SPC d a SPC p o t r e DEL DEL e r n e SPC c o m i n c i a r e SPC a SPC d i s c u t e r e SPC s e r i a m n e DEL DEL DEL m e n t e . RET RET ESC O A ESC O A ESC O A ESC O B ESC O B ESC O B C I a o C-a ESC c ! C-c C-f C-f M a i TAB p e r s o TAB r a d i TAB RET C-c C-c SPC p SPC RET C-d p p p p p p p p p p ESC s f a g g i o l i RET d n n n n n n n n d n n d d d d d d d n x g f n e p a , SPC g i a n n e t t i ESC DEL DEL DEL C-c C-c SPC RET d x 8 1 j n n n n n q C-x b . e m a TAB RET ESC O A - v e c c h i o ESC O B ESC O B DEL DEL DEL a l l e g a t i ESC O B ESC O B ESC O B ESC O B ESC O B ESC O A ESC O D C-x C-e ESC O A ESC O A ESC O A C-a ESC C-f ESC O B ESC O B ESC O B ESC O A ESC O D C-x C-e ESC x r e p o r t SPC e m a TAB RET Recent messages: Sending...done No following nondeleted message Expunging deleted messages...done Expunging deleted messages...done Saving file /home/pot/Mail/RMAIL... Wrote /home/pot/Mail/RMAIL [112 32 100 27 62 up 3 3 13] forward-sexp: Scan error: "Unbalanced parentheses", 2248, 21313 [112 32 100 27 62 up 3 3 13] Loading emacsbug...done From monnier@iro.umontreal.ca Thu Jul 23 18:34:47 2009 Received: (at 3907) by emacsbugs.donarmstrong.com; 24 Jul 2009 01:34:47 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.8 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 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" 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 Received: by ceviche.home (Postfix, from userid 20848) id 7CA66B41EA; Thu, 23 Jul 2009 17:55:00 -0400 (EDT) From: Stefan Monnier To: Francesco Potorti` Cc: 3907@debbugs.gnu.org Subject: Re: bug#3907: bad result for insert-kbd-macro Message-ID: References: Date: Thu, 23 Jul 2009 17:55:00 -0400 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) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > 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 From pot@gnu.org Wed Jul 29 04:46:16 2009 Received: (at 3907) by emacsbugs.donarmstrong.com; 29 Jul 2009 11:46:16 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.1 required=4.0 tests=AWL,FOURLA,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mx2.isti.cnr.it (mx2.isti.cnr.it [194.119.192.4]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6TBk98P005418 for <3907@emacsbugs.donarmstrong.com>; Wed, 29 Jul 2009 04:46:13 -0700 Received: from conversionlocal.isti.cnr.it by mx.isti.cnr.it (PMDF V6.4 #31598) id <01NBW6T1OB8G8ZITVN@mx.isti.cnr.it> for 3907@emacsbugs.donarmstrong.com; Wed, 29 Jul 2009 13:45:25 +0200 (MEST) Received: from tucano.isti.cnr.it (tucano.isti.cnr.it [146.48.81.102]) by mx.isti.cnr.it (PMDF V6.4 #31599) with ESMTPSA id <01NBW6SM8P0C95N8HU@mx.isti.cnr.it>; Wed, 29 Jul 2009 13:44:57 +0200 Received: from pot by tucano.isti.cnr.it with local (Exim 4.69) (envelope-from ) id 1MW7aa-0005pr-PU; Wed, 29 Jul 2009 13:44:56 +0200 Date: Wed, 29 Jul 2009 13:44:56 +0200 From: Francesco Potorti` Subject: Re: bug#3907: bad result for insert-kbd-macro In-reply-to: To: Stefan Monnier Cc: 3907@debbugs.gnu.org Message-id: Organization: X-INSM-ip-source: 146.48.81.102 Auth Done X-fingerprint: 4B02 6187 5C03 D6B1 2E31 7666 09DF 2DC9 BE21 6115 References: >> 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? Yes. In fact, I thought I had tried in Emacs 23, but by error I was running Emacs 22... >> 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). Right, thank you for the explanation. From cyd@stupidchicken.com Sat Aug 15 16:12:50 2009 Received: (at control) by emacsbugs.donarmstrong.com; 15 Aug 2009 23:12:50 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-1.6 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7FNCnSX004521 for ; Sat, 15 Aug 2009 16:12:50 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id F1C3D57E21C; Sat, 15 Aug 2009 19:13:47 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 3907 Date: Sat, 15 Aug 2009 19:13:47 -0400 Message-ID: <87d46wllg4.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii close 3907 thanks From unknown Wed Jun 18 00:14:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 13 Sep 2009 14:24:12 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator