File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -1457,19 +1457,23 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
1457
1457
(min (point ) max-pos)))))
1458
1458
1459
1459
(defun rust-format-diff-buffer ()
1460
- " Show diff to current buffer from rustfmt."
1460
+ " Show diff to current buffer from rustfmt.
1461
+
1462
+ Return the created process."
1461
1463
(interactive )
1462
1464
(unless (executable-find rust-rustfmt-bin)
1463
1465
(error " Could not locate executable \% s\" " rust-rustfmt-bin))
1464
- (make-process
1465
- :name " rustfmt-diff"
1466
- :command (list rust-rustfmt-bin " --check" (buffer-file-name ))
1467
- :buffer
1468
- (with-current-buffer
1469
- (get-buffer-create " *rustfmt-diff*" )
1470
- (erase-buffer )
1471
- (current-buffer ))
1472
- :sentinel 'rust-format-diff-buffer-sentinel ))
1466
+ (let ((proc
1467
+ (start-process " rustfmt-diff"
1468
+ (with-current-buffer
1469
+ (get-buffer-create " *rustfmt-diff*" )
1470
+ (erase-buffer )
1471
+ (current-buffer ))
1472
+ rust-rustfmt-bin
1473
+ " --check"
1474
+ (buffer-file-name ))))
1475
+ (set-process-sentinel proc 'rust-format-diff-buffer-sentinel )
1476
+ proc))
1473
1477
1474
1478
(defun rust-format-diff-buffer-sentinel (process _e )
1475
1479
(when (eq 'exit (process-status process))
You can’t perform that action at this time.
0 commit comments