GNU bug report logs - #18821
25.0.50; Let pp-macroexpand-expression expand only once

Previous Next

Package: emacs;

Reported by: michael_heerdegen <at> web.de

Date: Fri, 24 Oct 2014 23:15:02 UTC

Severity: wishlist

Found in version 25.0.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: michael_heerdegen <at> web.de
Subject: bug#18821: closed (Re: bug#18821: 25.0.50; Let pp-macroexpand-expression
 expand only once)
Date: Sun, 02 Nov 2014 05:47:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#18821: 25.0.50; Let pp-macroexpand-expression expand only once

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 18821 <at> debbugs.gnu.org.

-- 
18821: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18821
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 18821-done <at> debbugs.gnu.org
Subject: Re: bug#18821: 25.0.50; Let pp-macroexpand-expression expand only once
Date: Sun, 02 Nov 2014 01:46:23 -0400
>> I installed my macroexpand-1 into trunk.
> Thanks!
> Do you think that `pp-macroexpand-expression' and
> `pp-macroexpand-last-sexp' should use it?

Oh, yes, of course.  Same for emacs-lisp-macroexpand.
Sorry for forgetting about the actual bug report.  It's done now,


        Stefan

[Message part 3 (message/rfc822, inline)]
From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; Let pp-macroexpand-expression expand only once
Date: Sat, 25 Oct 2014 01:13:36 +0200
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)




This bug report was last modified 10 years and 203 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.