From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: macro atoms formatting Date: Thu, 19 Jan 2017 05:31:55 +0100 Message-ID: <87efzzd610.fsf@web.de> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1484800393 26524 195.159.176.226 (19 Jan 2017 04:33:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 19 Jan 2017 04:33:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.91 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Sam Nirvana Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 19 05:33:08 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cU4PM-0006Ol-0C for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Jan 2017 05:33:08 +0100 Original-Received: from localhost ([::1]:45918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cU4PQ-0003XD-Sn for geh-help-gnu-emacs@m.gmane.org; Wed, 18 Jan 2017 23:33:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cU4P0-0003X6-Hu for help-gnu-emacs@gnu.org; Wed, 18 Jan 2017 23:32:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cU4Ow-0001eq-9j for help-gnu-emacs@gnu.org; Wed, 18 Jan 2017 23:32:46 -0500 Original-Received: from mout.web.de ([212.227.17.12]:63030) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cU4Ow-0001dz-1a for help-gnu-emacs@gnu.org; Wed, 18 Jan 2017 23:32:42 -0500 Original-Received: from drachen.dragon ([92.74.161.233]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MPpE6-1cZ2Ss2fEQ-0050DP; Thu, 19 Jan 2017 05:31:56 +0100 In-Reply-To: (Sam Nirvana's message of "Tue, 17 Jan 2017 16:09:33 +0000 (UTC)") X-Provags-ID: V03:K0:rr5AlUQ2lY186RQS/YBvQrfla+bC6hQZs/7V2cYOZgQWsB4FkCX pkoD+ewoKh+Ck19MiHefIUg3iVN0QR1qlxh5l3fT6BNtxXW1+7EYR0ruudnntsY78Fh0hpt a4DERPwBEN2mWLqgAFKKSwjcjPv0M8yW9ifNLqaPxmnxXUQE0/gTu9IQpKNgwHzA7EnriA+ GMNaRV2gGfRRuyvqNFRSA== X-UI-Out-Filterresults: notjunk:1;V01:K0:rscG/no+g3Y=:t6hKt30w1x7RmL5JeVIhOF 3HVcZDyzYodjryvVCjUnG9ERlY6Uw09CtbNBpejKVCqvTVLebubemetiQqaTeHS6Z7P+qbw2w 5lVpQblnmT/g837sOi+AJ0YNSwkif1YI3r045BepSrofabFkP2a6r8ASfRYiYpj7u+ZKTpAXt L1eeZTn7dr4QNAcKLkrzxVmcQVLHNU+zN4JuCFr+aOJ91GmnJ+/MVS/OJVnibrYFz9tU3knkn HPCmKpxyPmUEpTIMO4oM6Rz/KJw/7zzEsJMUFFT/LO4lYBvfoT7aTeZZcNgmlMvll/ouMqVQh o8EXKz9ELP+dp5E3/mzR++qMa/C6gvAwnnLEPEo2Y9FGrY20HqhhswRCPGU0NN7dIy1yyMKhe X+isn40kVUfGtRFaiOFEsI/4JuENRA3PupAoyLc+yrkm9XxO2PIrPfOuNDvoKZwwy9QqjD6TH 1Pu22nXcPNNgrL7jH8LM/LMQSJFieW/bjHTB+iMWwrGXhEIjuo5PuM9wOvRYKHSYjYGCaKv8N +B9o8qOMf8oSW7b5639drD6znkuQWrkArlfFiw4mgPncwCZp8z1zXKPTZjYuy7sNYs3572sc9 aNgMA/Fqu5VLrGJe+s05K4Wg0jwzZYVyx441a//03G2N+q6/0yOd9hSGdefSg9+91oV6ci6Et d3DOWsJDhUzpyCZq11+NvBGcdLvRyIHRVgJb/mZHAu+pSNCafbTa1o1L/SXjRWThCTDSvhnto gpCTcJn0KAjf4nAbkQ0GfEsnNcV5y0SO7owjdfui7tMT13h3uakaUJ7FYcd4yHq0WDrVmGQ+ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112127 Archived-At: Sam Nirvana writes: > When I save a macro with M-x insert-kbd-macro sometimes Emacs prints a > well-formatted Lisp function: > > (fset 'amacro > (lambda (&optional arg) > "Keyboard macro" > (interactive "p") > (kmacro-exec-ring-item (quote ("
  • and other keystrokes..." > 0 "%d")) arg))) > > sometimes the code is formatted in a quite esoteric form: > > (fset 'amacro [?\M-! ? ?x ?m ... and many other ?-sequences... ?\C- > m]) Even if it doesn't look like, this is legal Lisp code. > apparently without a reason. > > How can I oblige Emacs to format the macro in the first way? (BTW, I only answer because I didn't see any reply to your question yet and I learned that no matter what I write someone tries to find the mistakes in what I said, so this is again just a teaser for those people to answer. Here we go...) I guess it depends on the keyboard macro, whether it uses "meta keyboard-macro" stuff like counters etc...dunno. But in general, AFAICT keyboard macros are not aware of the Lisp they cause to run - with other words, they are conceptually only recorded key sequences. So in some special cases you might get a lisp wrapper when using special stuff, and a plain key sequence else. There are ways to find the commands these keys cause to run, but I'm not sure whether there is something to generate nice looking lisp code automatically (I seldom use kmacros). Michael.