From 08d512a470be8a83c6dd954a57abac13f3e67828 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Mon, 25 Oct 2021 22:30:16 +0200 Subject: [PATCH] Add babashka to interpreter-mode-alist So files with a first line of e.g. `#!/bin/env bb` will be in clojure-mode. --- CHANGELOG.md | 4 ++++ clojure-mode.el | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dcf329b..45e25574 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ * Allow additional directories, beyond the default `clj[sc]`, to be correctly formulated by `clojure-expected-ns` via new `defcustom` entitled `clojure-directory-prefixes` * Recognize babashka projects (identified by the presence of `bb.edn`). +### Changes + +* [#604](https://github.com/clojure-emacs/clojure-mode/pull/604): Add `bb` (babashka) to `interpreter-mode-alist`. + ## 5.13.0 (2021-05-05) ### New features diff --git a/clojure-mode.el b/clojure-mode.el index a3aa43b5..95018a75 100644 --- a/clojure-mode.el +++ b/clojure-mode.el @@ -3005,7 +3005,9 @@ With universal argument \\[universal-argument], act on the \"top-level\" form." (add-to-list 'auto-mode-alist '("\\.cljc\\'" . clojurec-mode)) (add-to-list 'auto-mode-alist '("\\.cljs\\'" . clojurescript-mode)) ;; boot build scripts are Clojure source files - (add-to-list 'auto-mode-alist '("\\(?:build\\|profile\\)\\.boot\\'" . clojure-mode))) + (add-to-list 'auto-mode-alist '("\\(?:build\\|profile\\)\\.boot\\'" . clojure-mode)) + ;; babashka scripts are Clojure source files + (add-to-list 'interpreter-mode-alist '("bb" . clojure-mode))) (provide 'clojure-mode)