From f713020b6f70b510596b264ce367ae2079d94ea1 Mon Sep 17 00:00:00 2001 From: Michael Griffiths Date: Wed, 29 Apr 2015 21:46:42 +0100 Subject: [PATCH] Add cider-macroexpansion-print-metadata option Fixes #1090. --- CHANGELOG.md | 2 ++ cider-macroexpansion.el | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 243bb0aa2..7361fb971 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 8655ff9ac..cc2c46fca 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")))