summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md2
-rw-r--r--cider-macroexpansion.el8
2 files changed, 10 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 243bb0aa..7361fb97 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
diff --git a/cider-macroexpansion.el b/cider-macroexpansion.el
index 8655ff9a..cc2c46fc 100644
--- a/cider-macroexpansion.el
+++ b/cider-macroexpansion.el
@@ -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
@@ -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")))