Skip to content

Commit

Permalink
Add cider-macroexpansion-print-metadata option
Browse files Browse the repository at this point in the history
Fixes #1090.
  • Loading branch information
cichli committed Apr 29, 2015
1 parent d0571da commit f713020
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
* Middleware support for Piggieback 0.2.x.
* In the namespace browser, `d` and `s` are now bound to show the documentation
or the source respectively for the symbol at point.
* [#1090](https://github.com/clojure-emacs/cider/issues/1090): New defcustom, `cider-macroexpansion-print-metadata` (boolean.)
Controls whether metadata of forms is included in macroexpansion results. Defaults to nil.

### Changes

Expand Down
8 changes: 8 additions & 0 deletions cider-macroexpansion.el
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ Possible values are:
'cider-macroexpansion-display-namespaces
"0.8.0")

(defcustom cider-macroexpansion-print-metadata nil
"Determines if metadata is included in macroexpansion results."
:type 'boolean
:group 'cider
:package-version '(cider . "0.9.0"))

(defun cider-sync-request:macroexpand (expander expr &optional display-namespaces)
"Macroexpand, using EXPANDER, the given EXPR.
The default for DISPLAY-NAMESPACES is taken from
Expand All @@ -69,6 +75,8 @@ The default for DISPLAY-NAMESPACES is taken from
"display-namespaces"
(or display-namespaces
(symbol-name cider-macroexpansion-display-namespaces)))
(append (when cider-macroexpansion-print-metadata
(list "print-meta" "true")))
(nrepl-send-sync-request)
(nrepl-dict-get "expansion")))

Expand Down

0 comments on commit f713020

Please sign in to comment.