summaryrefslogtreecommitdiff
path: root/cider-macroexpansion.el
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@tradeo.com>2014-08-08 12:18:12 +0300
committerBozhidar Batsov <bozhidar@tradeo.com>2014-08-08 12:18:12 +0300
commit30d60b1ada9d28f432ef8fd406958467a9f5e49d (patch)
treec98f9a29980aa9ea6bd9e29a8d6d5728b0312316 /cider-macroexpansion.el
parenteabf404487df32dd73fd11a83d8b90a916b6c420 (diff)
[Fix #705] Rework macroexpansion namespace display logic
Diffstat (limited to 'cider-macroexpansion.el')
-rw-r--r--cider-macroexpansion.el35
1 files changed, 21 insertions, 14 deletions
diff --git a/cider-macroexpansion.el b/cider-macroexpansion.el
index 2ab9d1a6..11306b47 100644
--- a/cider-macroexpansion.el
+++ b/cider-macroexpansion.el
@@ -36,22 +36,27 @@
(push cider-macroexpansion-buffer cider-ancilliary-buffers)
-(defcustom cider-macroexpansion-suppress-namespaces 'tidy
+(defcustom cider-macroexpansion-display-namespaces 'tidy
"Determines if namespaces are displayed in the macroexpansion buffer.
Possible values are:
- nil ;=> Vars are fully-qualified in the expansion
- t ;=> Vars are displayed without namespace qualification
- 'tidy ;=> Vars that are :refer-ed or defined in the current namespace are
- displayed with their simple name, non-refered vars from other
- namespaces are refered using the alias for that namespace (if
- defined), other vars are displayed fully qualified."
- :type '(choice (const :tag "Suppress namespaces" t)
- (const :tag "Show namespaces" nil)
+ 'qualified ;=> Vars are fully-qualified in the expansion
+ 'none ;=> Vars are displayed without namespace qualification
+ 'tidy ;=> Vars that are :refer-ed or defined in the current namespace are
+ displayed with their simple name, non-refered vars from other
+ namespaces are refered using the alias for that namespace (if
+ defined), other vars are displayed fully qualified."
+ :type '(choice (const :tag "Suppress namespaces" none)
+ (const :tag "Show fully-qualified namespaces" qualified)
(const :tag "Show namespace aliases" tidy))
:group 'cider
:package-version '(cider . "0.7.0"))
+(define-obsolete-variable-alias
+ 'cider-macroexpansion-suppress-namespaces
+ 'cider-macroexpansion-display-namespaces
+ "0.8.0")
+
(defun cider-macroexpand-undo (&optional arg)
"Undo the last macroexpansion, using `undo-only'.
ARG is passed along to `undo-only'."
@@ -66,11 +71,13 @@ This variable specifies both what was expanded and the expander.")
(defun cider-macroexpansion (expander expr)
"Macroexpand, using EXPANDER, the given EXPR."
(cider-ensure-op-supported expander)
- (plist-get (nrepl-send-sync-request
- (list "op" expander
- "code" expr
- "ns" (cider-current-ns)
- "suppress-namespaces" cider-macroexpansion-suppress-namespaces)) :value))
+ (plist-get
+ (nrepl-send-sync-request
+ (list "op" expander
+ "code" expr
+ "ns" (cider-current-ns)
+ "display-namespaces" (symbol-name cider-macroexpansion-display-namespaces)))
+ :value))
(defun cider-macroexpand-expr (expander expr)
"Macroexpand, use EXPANDER, the given EXPR."