hi,
the attached patch provides a function, slmie-macroexpand-in-place, which does exactly what slmie-macroexpand-1 does but replaces the text of the form with its expansion. i've found this very usefull in a *SLME Macroexpansion* buffer and i plan on commiting it. however i don't know what keys to bind it to.
is there a way to create a minor-mode such that the slime-macroexpand-1-in-place and slime-macroexpand-all-in-place are bound to the same keys as what the user has bound slime-macroexpand-1 and slmie-macroexpand-all to?
Marco Baringer mb@bese.it writes:
the attached patch provides a function, slmie-macroexpand-in-place, which does exactly what slmie-macroexpand-1 does but replaces the text of the form with its expansion. i've found this very usefull in a *SLME Macroexpansion* buffer and i plan on commiting it. however i don't know what keys to bind it to.
Prefix argument to slime-macroexpand?
So that C-c RET is slime-macroexpand, and C-u C-c RET is the new thing?
Just a though.
Cheers,
-- Nikodemus Schemer: "Buddha is small, clean, and serious." Lispnik: "Buddha is big, has hairy armpits, and laughs."
Nikodemus Siivola wrote:
Marco Baringer mb@bese.it writes:
the attached patch provides a function, slmie-macroexpand-in-place, which does exactly what slmie-macroexpand-1 does but replaces the text of the form with its expansion. i've found this very usefull in a *SLME Macroexpansion* buffer and i plan on commiting it. however i don't know what keys to bind it to.
Prefix argument to slime-macroexpand?
So that C-c RET is slime-macroexpand, and C-u C-c RET is the new thing?
my plan, which may be a bit drastic, was to not bind these in slime-mode and replace the bindings of slime-macroexand-(1|all) with the new things in the slime-macroexpansion mode.
i'm guesing that if you're in a lisp buffer and you macroexpand you don't ever want your code replaced with the expansion, and if you're already in a macroexpansion buffer it's more helpfull to see the expansion within the context of the outer macro. though this changing of keybindings may be really counter-intuitive.
Marco Baringer mb@bese.it writes:
the attached patch provides a function, slmie-macroexpand-in-place, which does exactly what slmie-macroexpand-1 does but replaces the text of the form with its expansion. i've found this very usefull in a *SLME Macroexpansion* buffer and i plan on commiting it. however i don't know what keys to bind it to.
Hey Marco, that sounds really great! I made a request for something on that line about a month ago in january:
http://common-lisp.net/pipermail/slime-devel/2006-January/004525.html
Personally, I'd like that `C-c C-m' or `C-c RET' respectively works in-place within the Macroexpansion buffer, and when prefixed a new Macroexpansion buffer is created as hinted at in my post above.
-T.
* Marco Baringer [2006-02-25 14:04+0100] writes:
hi,
the attached patch provides a function, slmie-macroexpand-in-place,
I think you forgot the attachment :-)
which does exactly what slmie-macroexpand-1 does but replaces the text of the form with its expansion. i've found this very usefull in a *SLME Macroexpansion* buffer and i plan on commiting it. however i don't know what keys to bind it to.
is there a way to create a minor-mode such that the slime-macroexpand-1-in-place and slime-macroexpand-all-in-place are bound to the same keys as what the user has bound slime-macroexpand-1 and slmie-macroexpand-all to?
Not that I know of. But `where-is' or `where-is-internal' may be good enough to do it yourself.
Helmut.
Helmut Eller heller@common-lisp.net writes:
- Marco Baringer [2006-02-25 14:04+0100] writes:
hi,
the attached patch provides a function, slmie-macroexpand-in-place,
I think you forgot the attachment :-)
oops.
which does exactly what slmie-macroexpand-1 does but replaces the text of the form with its expansion. i've found this very usefull in a *SLME Macroexpansion* buffer and i plan on commiting it. however i don't know what keys to bind it to.
is there a way to create a minor-mode such that the slime-macroexpand-1-in-place and slime-macroexpand-all-in-place are bound to the same keys as what the user has bound slime-macroexpand-1 and slmie-macroexpand-all to?
Not that I know of. But `where-is' or `where-is-internal' may be good enough to do it yourself.
the attached patch attempts to do this, tell me what you think.