From 0127e5fc5477a88baf5d4242523f217aa72a5e27 Mon Sep 17 00:00:00 2001 From: Aaron Miller Date: Mon, 5 Aug 2013 16:17:33 -0700 Subject: [PATCH] Fully macroexpand using macroexpand-all --- README.markdown | 5 +++-- plugin/fireplace.vim | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.markdown b/README.markdown index 8ebac2a..1a26159 100644 --- a/README.markdown +++ b/README.markdown @@ -68,8 +68,9 @@ Standard stuff here. `:Eval` evaluates a range (`:%Eval` gets the whole file), `:Require` requires a namespace with `:reload` (`:Require!` does `:reload-all`), either the current buffer or a given argument. There's a `cp` operator that evaluates a given motion (`cpp` for the expression under the -cursor). `cm` and `c1m` are similar, but they only run `macroexpand` and -`macroexpand-1` instead of evaluating the form entirely. +cursor). `cm` and `c1m` are similar, but they only run +`clojure.walk/macroexpand-all` and `macroexpand-1` instead of evaluating the +form entirely. Any failed evaluation loads the stack trace into the location list, which can be easily accessed with `:lopen`. diff --git a/plugin/fireplace.vim b/plugin/fireplace.vim index c7569bf..3397337 100644 --- a/plugin/fireplace.vim +++ b/plugin/fireplace.vim @@ -540,7 +540,7 @@ function! fireplace#evalprint(expr) abort endfunction function! fireplace#macroexpand(fn, form) abort - return fireplace#evalprint('(clojure.core/'.a:fn.' (quote '.a:form.'))') + return fireplace#evalprint('('.a:fn.' (quote '.a:form.'))') endfunction let g:fireplace#reader = @@ -619,11 +619,11 @@ function! s:filterop(type) abort endfunction function! s:macroexpandop(type) abort - call fireplace#macroexpand("macroexpand", s:opfunc(a:type)) + call fireplace#macroexpand("clojure.walk/macroexpand-all", s:opfunc(a:type)) endfunction function! s:macroexpand1op(type) abort - call fireplace#macroexpand("macroexpand-1", s:opfunc(a:type)) + call fireplace#macroexpand("clojure.core/macroexpand-1", s:opfunc(a:type)) endfunction function! s:printop(type) abort