2020年04月29日現在quickrun.elでKotlinも使えるようになったため、該当のバージョンにすればこちらの記事の設定は不要になります。メンテナの方々ありがとうございました。
KotlinのPlayground を使ってる時にEmacsで書いてサクッと実行を試したいと思い
quickrunでKotlin対応してないかを調べた結果、READMEに追加方法がありJavaを参考に書いた。
init.el
(quickrun-add-command "kotlin"
'((:command . "kotlin")
(:exec . ("kotlinc %o %s" "%c %NKt %a"))
(:remove . ("%nKt.class"))
(:tempfile . nil)
(:description . "Compile Kotlin file and execute")
)
:mode 'kotlin-mode)
Playground自体は他の人と共有する時に便利なので引き続き使っていくけど、個人で試すだけであれば積極的に使っていく。
(参考)
https://github.com/syohex/emacs-quickrun
https://github.com/syohex/emacs-quickrun/blob/55bbe5d54b80206ea5a60bf2f58eb6368b2c8201/quickrun.el#L237