Fully macroexpand using macroexpand-all

This commit is contained in:
Aaron Miller 2013-08-05 16:17:33 -07:00 committed by Tim Pope
parent 235a4ec3e8
commit 0127e5fc54
2 changed files with 6 additions and 5 deletions

View File

@ -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`.

View File

@ -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