-
Notifications
You must be signed in to change notification settings - Fork 101
/
rustic-rustfix.el
33 lines (25 loc) · 993 Bytes
/
rustic-rustfix.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
;;; rustic-rustfix.el --- Support for rustfix -*- lexical-binding:t -*-
;;; Commentary:
;; This library implements support for `rustfix', a tool that applies
;; the suggestions made by `rustc'.
;;; Code:
(require 'rustic-cargo)
(defvar rustic-rustfix-process-name "rustic-rustfix-process"
"Process name for rustfix processes.")
(defvar rustic-rustfix-buffer-name "*cargo-rustfix*"
"Buffer name for rustfix buffers.")
(define-derived-mode rustic-rustfix-mode rustic-compilation-mode "rustfix"
:group 'rustic)
;;;###autoload
(defun rustic-rustfix ()
"Run 'cargo fix'."
(interactive)
(let* ((command (list (rustic-cargo-bin) "fix" "--allow-dirty"))
(err-buf rustic-rustfix-buffer-name)
(proc rustic-rustfix-process-name)
(mode 'rustic-rustfix-mode))
(rustic-compilation-process-live)
(rustic-compilation-start command (list :buffer err-buf :process proc :mode mode))))
;;; _
(provide 'rustic-rustfix)
;;; rustic-rustfix.el ends here