clojure-emacs / clojure-emacs/clojure-mode

Indentation of `clojure.test/are`

オープン
#548 コメント 8 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Emacs Lisp
スター
1k
フォーク
249
PR マージ指標
30日以内にマージされた PR はありません

説明

## Expected behavior

I was expecting `clojure-mode`'s indentation to behave similar to `cider-format` and `lein cljfmt`. Is there some way to configure `clojure-mode` to indent the same way as `cider-format`?

## Actual behavior

The macro `clojure.test/are` is indented one way with `M-x cider-format` (and `lein cljfmt`), but another way when using `clojure-mode`'s indentation rules (with `aggressive-indent-mode`). The latter uses one space less than the former for the second argument to `are` (when it is on a new line).

## Steps to reproduce the problem
The code is formatted as following using `clojure-mode` indentation:
```clojure
(deftest are-test
(are [x y]
(= x y)
1 1
2 2))

```

And as following when using `cider-format` indentation (note the extra space on line 3):
```clojure
((deftest are-test
(are [x y]
(= x y)
1 1
2 2))
```

## Environment & Version information

### clojure-mode version information
```
clojure-mode (version 5.11.0)
```

### Emacs version
```
GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.12, cairo version 1.17.3) of 2019-11-26
```

### Operating system

Arch Linux

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

aggressive-indent-mode を使い、clojure-mode のインデント規則で `clojure.test/are` の例を再現し、その後 `M-x cider-format` および `lein cljfmt` と比較します。clojure-mode のインデントのエントリポイントを追跡し、余分なスペースを設定できるか、または一貫させられるかを判断します。表示されたフォームのインデントが一致すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
clojure, emacs-lisp
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。