summaryrefslogtreecommitdiff
path: root/rust-mode-treesitter.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2024-03-27 16:53:42 +0100
committerJonas Bernoulli <jonas@bernoul.li>2024-03-27 16:59:55 +0100
commit7c5de035fab1b46926964b0defebef26357a5209 (patch)
tree2698c3e0e14e3b97a582617692a3d0fd1dbcc0ca /rust-mode-treesitter.el
parent1ce4f8e26606462d73dc0895983d733580469124 (diff)
downloadrust-mode-7c5de035fab1b46926964b0defebef26357a5209.tar.gz
Fix dependencies between rust-mode implementations
"rust-prog-mode.el" and "rust-mode-treesitter.el" provide competing implementations of `rust-mode'. Both implementations depend on code in "rust-mode.el", and thus must require that. Doing that is complicated by the fact that "rust-mode.el" loads one of these libraries, depending on `rust-mode-treesitter-derive's value. Address this conflict by: 1. Requiring feature `rust-mode' in the two libraries that implement the `rust-mode' major-mode and that use things defined in "rust-mode.el". 2. Moving the require forms for these two libraries in "rust-mode.el", below the `provide' form for `rust-mode'.
Diffstat (limited to 'rust-mode-treesitter.el')
-rw-r--r--rust-mode-treesitter.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/rust-mode-treesitter.el b/rust-mode-treesitter.el
index 89c7cd4..21eab59 100644
--- a/rust-mode-treesitter.el
+++ b/rust-mode-treesitter.el
@@ -5,12 +5,13 @@
;;; Code:
+(require 'rust-mode)
+
+;; Do not compile or load on Emacs releases that don't support
+;; this. See https://github.com/rust-lang/rust-mode/issues/520.
(when (version<= "29.1" emacs-version)
- ;; We have the when macro because of
- ;; https://github.com/rust-lang/rust-mode/issues/520
(require 'treesit)
(require 'rust-ts-mode)
- (require 'rust-common)
(define-derived-mode rust-mode rust-ts-mode "Rust"
"Major mode for Rust code.