summaryrefslogtreecommitdiff
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
parenteabf404487df32dd73fd11a83d8b90a916b6c420 (diff)
[Fix #705] Rework macroexpansion namespace display logic
-rw-r--r--CHANGELOG.md6
-rw-r--r--cider-macroexpansion.el35
2 files changed, 27 insertions, 14 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5bfe3c8a..9000f86f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,6 +25,12 @@ simpler to gain understanding of what you're using.
`nrepl-describe-session` -> `nrepl-request:describe`
`nrepl-create-client-session` -> `nrepl-request:clone`
+* Renamed `cider-macroexpansion-suppress-namespaces` to `cider-macroexpansion-display-namespaces`.
+
+### Bugs fixed
+
+* [#705](https://github.com/clojure-emacs/cider/pull/705): Fixed macroexpansion
+ bug for `tidy` namespace display.
## 0.7.0 / 2014-08-05
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."