From: Eduardo Ochs <eduardoochs@gmail.com>
To: Heime <heimeborgia@protonmail.com>
Cc: Heime via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org>
Subject: Re: Printing code made by a macro
Date: Sat, 5 Aug 2023 21:31:09 -0300 [thread overview]
Message-ID: <CADs++6hqnGcjt+ZkpsMxpYpNKhz7axXGjF0YkqqTF+uxoGhCTg@mail.gmail.com> (raw)
In-Reply-To: <wSmn3q-fbkGyNWfOw3e7k5-PD0edgsH1BHirJllkxYeSJVfS6PSt52AhNpIpb9U8DJ0Q9MNRFPK8McdRWHiC3_VmBX2Ric-UTwfYPIZu1As=@protonmail.com>
On Sat, 5 Aug 2023 at 20:43, Heime <heimeborgia@protonmail.com> wrote:
>
> Is there a proper way to display the code produced by a macro ? Perhaps
> call
> a function to print it by passing the macro command ?
>
> (print-code (mymacro (* 2 3) (* 5 8) ))
>
> Which would print (+ 3 8)
>
> How would one write print-code ?
>
Hi Heime,
eev has a function, called "find-eppm", that takes a sexp, expands it
with macro-expand, pretty-prints the expansion, and displays the
pretty-printed code in a temporary buffer. If you'd like to try it,
install eev, run this,
(require 'eev-load)
and then type `C-x C-e' after the last parenthesis here:
(find-eppm '
(define-minor-mode MAIN-mode
"Help 1"
:init-value t
:global t
:lighter (propertize " MAIN" 'face 'region))
)
The reason for the "(require 'eev-load)" is explained here:
http://anggtwu.net/eev-intros/find-eev-quick-intro.html#1
http://anggtwu.net/eev-current/eev-load.el.html#autoloads
Cheers,
Edrx
next prev parent reply other threads:[~2023-08-06 0:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-05 23:42 Printing code made by a macro Heime
2023-08-06 0:31 ` Eduardo Ochs [this message]
2023-08-06 0:44 ` Heime
2023-08-06 0:50 ` Eduardo Ochs
2023-08-06 1:15 ` Heime
2023-08-06 2:16 ` Heime
2023-08-06 2:54 ` Eduardo Ochs
2023-08-06 3:36 ` Heime
2023-08-06 17:23 ` Heime
2023-08-06 20:36 ` Eduardo Ochs
2023-08-06 22:45 ` Heime
2023-08-06 23:11 ` Emanuel Berg
2023-08-06 18:10 ` Heime
2023-08-06 5:04 ` Eli Zaretskii
2023-08-06 6:22 ` Sebastian Miele
2023-08-07 19:54 ` Pierre Rouleau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADs++6hqnGcjt+ZkpsMxpYpNKhz7axXGjF0YkqqTF+uxoGhCTg@mail.gmail.com \
--to=eduardoochs@gmail.com \
--cc=heimeborgia@protonmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).