Skip to content

Let clojure-ts-mode derive from clojure-mode for Emacs 30+ #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- [#38]: Add support for `in-ns` forms in `clojure-ts-find-ns`.
- [#46]: Fix missing `comment-add` variable in `clojure-ts-mode-variables` mentioned in [#26]
- Add imenu support for `deftest` definitions.
- [#53]: Let `clojure-ts-mode` derive from `clojure-mode` for Emacs 30+.

## 0.2.2 (2024-02-16)

Expand Down
5 changes: 5 additions & 0 deletions clojure-ts-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,11 @@ See `clojure-ts--font-lock-settings' for usage of MARKDOWN-AVAILABLE."
(when (fboundp 'transpose-sexps-default-function)
(setq-local transpose-sexps-function #'transpose-sexps-default-function)))))

;; For Emacs 30+, so that `clojure-ts-mode' is treated as deriving from
;; `clojure-mode'
(when (fboundp #'derived-mode-add-parents)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest adding a comment here explaining this, given that this API is fairly new and unknown.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I've done.

(derived-mode-add-parents 'clojure-ts-mode '(clojure-mode)))

;;;###autoload
(define-derived-mode clojure-ts-clojurescript-mode clojure-ts-mode "ClojureScript[TS]"
"Major mode for editing ClojureScript code.
Expand Down
Loading