Skip to content

Commit f713020

Browse files
committed
Add cider-macroexpansion-print-metadata option
Fixes #1090.
1 parent d0571da commit f713020

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
* Middleware support for Piggieback 0.2.x.
4848
* In the namespace browser, `d` and `s` are now bound to show the documentation
4949
or the source respectively for the symbol at point.
50+
* [#1090](https://github.com/clojure-emacs/cider/issues/1090): New defcustom, `cider-macroexpansion-print-metadata` (boolean.)
51+
Controls whether metadata of forms is included in macroexpansion results. Defaults to nil.
5052

5153
### Changes
5254

cider-macroexpansion.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ Possible values are:
5757
'cider-macroexpansion-display-namespaces
5858
"0.8.0")
5959

60+
(defcustom cider-macroexpansion-print-metadata nil
61+
"Determines if metadata is included in macroexpansion results."
62+
:type 'boolean
63+
:group 'cider
64+
:package-version '(cider . "0.9.0"))
65+
6066
(defun cider-sync-request:macroexpand (expander expr &optional display-namespaces)
6167
"Macroexpand, using EXPANDER, the given EXPR.
6268
The default for DISPLAY-NAMESPACES is taken from
@@ -69,6 +75,8 @@ The default for DISPLAY-NAMESPACES is taken from
6975
"display-namespaces"
7076
(or display-namespaces
7177
(symbol-name cider-macroexpansion-display-namespaces)))
78+
(append (when cider-macroexpansion-print-metadata
79+
(list "print-meta" "true")))
7280
(nrepl-send-sync-request)
7381
(nrepl-dict-get "expansion")))
7482

0 commit comments

Comments
 (0)