branch: elpa/clojure-mode
commit 8441ed525ee99ddcbe3cec6a927cb18ebf599bd2
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Add interpreter-mode-alist entries for Clojure scripting tools
    
    Register clojure, clj, planck, joker, and jank interpreters so that
    scripts with shebang lines like #!/usr/bin/env bb are automatically
    opened in the appropriate Clojure mode.
    
    Closes #439
---
 CHANGELOG.md    |  4 ++++
 clojure-mode.el | 10 +++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d113e5795f..07337eba6e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,10 @@
 * [#686](https://github.com/clojure-emacs/clojure-mode/issues/686): Fix 
`clojure-find-def` failing when comments appear between the `def` form and the 
symbol name.
 * [#637](https://github.com/clojure-emacs/clojure-mode/issues/637): Fix 
`clojure-find-def` failing on symbols containing special characters (e.g. 
`defn+`).
 
+### New features
+
+* [#439](https://github.com/clojure-emacs/clojure-mode/issues/439): Add 
`interpreter-mode-alist` entries for `clojure`, `clj`, `planck`, `joker`, and 
`jank`, so that scripts with shebang lines are recognized automatically.
+
 ### Changes
 
 * Bump the minimum required Emacs version to 27.1.
diff --git a/clojure-mode.el b/clojure-mode.el
index 8584c77cfd..3d8e5a3214 100644
--- a/clojure-mode.el
+++ b/clojure-mode.el
@@ -3334,10 +3334,14 @@ With universal argument \\[universal-argument], act on 
the \"top-level\" form."
   (add-to-list 'auto-mode-alist '("\\.joke\\'" . joker-mode))
   ;; boot build scripts are Clojure source files
   (add-to-list 'auto-mode-alist '("\\(?:build\\|profile\\)\\.boot\\'" . 
clojure-mode))
-  ;; babashka scripts are Clojure source files
+  ;; interpreter-mode-alist entries for Clojure scripting tools
   (add-to-list 'interpreter-mode-alist '("bb" . clojure-mode))
-  ;; nbb scripts are ClojureScript source files
-  (add-to-list 'interpreter-mode-alist '("nbb" . clojurescript-mode)))
+  (add-to-list 'interpreter-mode-alist '("clojure" . clojure-mode))
+  (add-to-list 'interpreter-mode-alist '("clj" . clojure-mode))
+  (add-to-list 'interpreter-mode-alist '("nbb" . clojurescript-mode))
+  (add-to-list 'interpreter-mode-alist '("planck" . clojurescript-mode))
+  (add-to-list 'interpreter-mode-alist '("joker" . joker-mode))
+  (add-to-list 'interpreter-mode-alist '("jank" . jank-mode)))
 
 (provide 'clojure-mode)
 

Reply via email to