From: Michael Heerdegen <michael_heerdegen@web.de>
To: 18821@debbugs.gnu.org
Subject: bug#18821: 25.0.50; Let pp-macroexpand-expression expand only once
Date: Sat, 25 Oct 2014 01:13:36 +0200 [thread overview]
Message-ID: <87bnp1ukm7.fsf@web.de> (raw)
Hello,
this is a feature request.
The problem is the following:
When writing a complex macro, one often wants to check some examples to
see if it expands code as intended.
There are different ways of doing that: M-x pp-macroexpand-expression or
M-x emacs-lisp-macroexpand for example.
But there is a problem: if the macro expansion is a toplevel call to
some other macro, this one will also be expanded, because the above
commands use `macroexpand' which successively expands until the result
is not a macro call. This is not useful for checking macro expansions.
I want to suggest to alter `pp-macroexpand-expression', or to provide a
new command, based on a function that expands only one time like
(defun macroexpand1 (expr)
(apply (cdr (symbol-function (car expr))) (cdr expr)))
(This can no doubt be improved, e.g. to DTRT for autoloaded macros.)
Or did I miss something? Opinions?
Thanks,
Michael.
In GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.1)
of 2014-10-17 on drachen
Windowing system distributor `The X.Org Foundation', version 11.0.11601000
System Description: Debian GNU/Linux testing (jessie)
next reply other threads:[~2014-10-24 23:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-24 23:13 Michael Heerdegen [this message]
2014-10-28 17:00 ` bug#18821: 25.0.50; Let pp-macroexpand-expression expand only once Stefan Monnier
2014-10-29 3:53 ` Michael Heerdegen
2014-10-31 21:36 ` Stefan Monnier
2014-11-02 4:07 ` Michael Heerdegen
2014-11-02 5:46 ` Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bnp1ukm7.fsf@web.de \
--to=michael_heerdegen@web.de \
--cc=18821@debbugs.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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.