[emacs] Use rust-ts-mode, but rustfmt

This commit is contained in:
John Doty 2023-10-26 16:21:26 +00:00
parent 12f22cab24
commit 278683bf88

View file

@ -1130,11 +1130,22 @@ Or, uh, Objective C, I guess."
;; ================================================================= ;; =================================================================
(use-package rust-mode :ensure t (use-package rust-mode :ensure t
:mode "\\.rs\\'" :mode "\\.rs\\'"
:commands rust-format-buffer ; 2023-10-26 Make this command available even when the mode isn't used.
:config :config
(setq rust-format-on-save t)) (setq rust-format-on-save t))
(use-package flycheck-rust :ensure t ;; 2023-10-18 We're using eglot now, I presume we don't want this.
:hook (rust-mode . flycheck-rust-setup)) ;; (use-package flycheck-rust :ensure t
;; :hook (rust-mode . flycheck-rust-setup))
(defun my/rust-ts-mode-hook ()
"Extra stuff for my rust mode."
;; 2023-10-26 Use rust-format-buffer instead of eglot-format-buffer, I was
;; having a hard time and it looked like eglot-format-buffer was screwing
;; things up.
(add-hook 'before-save-hook 'rust-format-buffer 0 t))
(add-hook 'rust-ts-mode-hook 'my/rust-ts-mode-hook)
;; ================================================================= ;; =================================================================
;; Clojure ;; Clojure