Skip to content

Commit d3aa417

Browse files
committed
Add tests and documentation for the indentation config changes
1 parent d477772 commit d3aa417

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
* Add `.cljc` to `auto-mode-alist`.
88
* [#281](https://github.com/clojure-emacs/clojure-mode/pull/281): Add support for namespace-prefixed definition forms.
99
* Remove `clojure-mark-string`.
10-
* Require Emacs 24.3+.
10+
* [#283](https://github.com/clojure-emacs/clojure-mode/pull/283): You can now specify different indentation settings for ns-prefixed symbols.
11+
* [#285](https://github.com/clojure-emacs/clojure-mode/issues/285): Require Emacs 24.3+.
1112

1213
### Bugs fixed
1314

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ You can do so by putting the following in your config:
7373
(put-clojure-indent '->> 1)
7474
```
7575

76+
You can also specify different indentation settings for symbols
77+
prefixed with some ns (or ns alias):
78+
79+
```el
80+
(put-clojure-indent 'do 0)
81+
(put-clojure-indent 'my-ns/do 1)
82+
```
83+
7684
This means that the body of the `->/->>` is after the first argument.
7785

7886
A more compact way to do the same thing is:

test/clojure-mode-indentation-test.el

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,27 @@ values of customisable variables."
133133
|\"some doc string
134134
- some note\"")
135135

136+
;; we can specify different indentation for symbol with some ns prefix
137+
(put-clojure-indent 'bala 0)
138+
(put-clojure-indent 'ala/bala 1)
139+
140+
(check-indentation symbol-without-ns
141+
"
142+
(bala
143+
|one)"
144+
"
145+
(bala
146+
|one)")
147+
148+
(check-indentation symbol-with-ns
149+
"
150+
(ala/bala top
151+
|one)"
152+
"
153+
(ala/bala top
154+
|one)")
155+
156+
136157
(provide 'clojure-mode-indentation-test)
137158

138159
;; Local Variables:

0 commit comments

Comments
 (0)