[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/rust-mode 4ec735e 300/486: Add stderr output from rustfmt
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/rust-mode 4ec735e 300/486: Add stderr output from rustfmt on exit code 3 |
Date: |
Sat, 7 Aug 2021 09:25:40 -0400 (EDT) |
branch: elpa/rust-mode
commit 4ec735e0fb993724fc264f6937267a898e30e6bf
Author: Christian Howe <cjhowe7@gmail.com>
Commit: Christian Howe <cjhowe7@gmail.com>
Add stderr output from rustfmt on exit code 3
---
rust-mode.el | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/rust-mode.el b/rust-mode.el
index 1fce291..8d81efa 100644
--- a/rust-mode.el
+++ b/rust-mode.el
@@ -1195,13 +1195,25 @@ This is written mainly to be used as
`end-of-defun-function' for Rust."
(with-current-buffer (get-buffer-create "*rustfmt*")
(erase-buffer)
(insert-buffer-substring buf)
- (let ((ret (call-process-region (point-min) (point-max) rust-rustfmt-bin t
'(t nil) nil)))
- (if (or (zerop ret) (= ret 3))
- (progn
- (if (not (string= (buffer-string) (with-current-buffer buf
(buffer-string))))
- (copy-to-buffer buf (point-min) (point-max)))
- (kill-buffer))
- (error "Rustfmt failed, see *rustfmt* buffer for details")))))
+ (let ((tmpf (make-temp-file "rustfmt")))
+ (let ((ret (call-process-region (point-min) (point-max) rust-rustfmt-bin
+ t `(t ,tmpf) nil)))
+ (format-message "%d" ret)
+ (cond
+ ((zerop ret)
+ (error "Rustfmt failed, see *rustfmt* buffer for details"))
+ ((= ret 3)
+ (if (not (string= (buffer-string)
+ (with-current-buffer buf (buffer-string))))
+ (copy-to-buffer buf (point-min) (point-max)))
+ (erase-buffer)
+ (insert-file-contents tmpf)
+ (error "Rustfmt could not format some lines, see *rustfmt* buffer
for details"))
+ (t
+ (if (not (string= (buffer-string)
+ (with-current-buffer buf (buffer-string))))
+ (copy-to-buffer buf (point-min) (point-max)))
+ (kill-buffer)))))))
(defconst rust--format-word
"\\b\\(else\\|enum\\|fn\\|for\\|if\\|let\\|loop\\|match\\|struct\\|unsafe\\|while\\)\\b")
(defconst rust--format-line "\\([\n]\\)")
- [nongnu] elpa/rust-mode 8039d12 286/486: Merge pull request #191 from Wooble/readme_link, (continued)
- [nongnu] elpa/rust-mode 8039d12 286/486: Merge pull request #191 from Wooble/readme_link, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0de149a 287/486: Merge pull request #190 from mrBliss/imenu-extern, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode ee7043b 289/486: Use syntax-propertize-function, not font-lock-syntactic-keywords, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode d7458c2 290/486: set open-paren-in-column-0-is-defun-start to nil, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 4d651ab 295/486: Merge pull request #197 from tromey/syntax-propertize, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 85befb9 296/486: Merge pull request #201 from tromey/question-indentation, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 5469d9b 297/486: fix rust indentation bug, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 367a89c 299/486: Allow formatting with long lines, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 610fe1f 305/486: Address review comments, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 72c479b 311/486: Add `rust-run-clippy' and `rust-buffer-project' with testing paraphernalia., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 4ec735e 300/486: Add stderr output from rustfmt on exit code 3,
ELPA Syncer <=
- [nongnu] elpa/rust-mode 9afe997 313/486: Declare `rust-buffer-project' and require `json' at runtime., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode b4077f8 314/486: Add `rust-cargo-bin' custom variable., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode d2bb17c 315/486: Skip `rust-test-project-located' without cargo and avoid `find-file' in test., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0985f5f 318/486: Merge pull request #217 from Aankhen/add-clippy-command, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 34cc528 319/486: Highlight question mark operator using new `rust-question-mark-face'., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 2a9fcd0 321/486: Add syntax highlighting and imenu support for `union`, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 89320ad 323/486: Highlight interpolation in arguments to print! &c., ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode e48a650 329/486: Merge pull request #225 from Aankhen/add-var-colours, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 6e9db46 331/486: Merge pull request #230 from tromey/fix-indentation-bug, ELPA Syncer, 2021/08/07
- [nongnu] elpa/rust-mode 0e832ec 340/486: Remove `float`, `int`, and `uint` as built-in types., ELPA Syncer, 2021/08/07