From bc62a50d5d30f992cb3496dda75d6c470cb95cee Mon Sep 17 00:00:00 2001 From: Roman Hargrave Date: Fri, 11 Oct 2024 11:42:54 -0700 Subject: [PATCH] Switch buffers after spawning rustfmt This fixes a problem wherein buffer-local values for rustic-rustfmt-args were effectively ignored --- rustic-rustfmt.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/rustic-rustfmt.el b/rustic-rustfmt.el index 14f2b77..4a8af7c 100644 --- a/rustic-rustfmt.el +++ b/rustic-rustfmt.el @@ -123,16 +123,16 @@ and it's `cdr' is a list of arguments." (--each files (unless (file-exists-p it) (error (format "File %s does not exist." it)))) - (with-current-buffer err-buf - (let* ((c `(,rustfmt - ,@(split-string rustic-rustfmt-args) - ,@command "--" ,@files)) - (proc (rustic-make-process :name rustic-format-process-name - :buffer err-buf - :command (remove "" c) - :filter #'rustic-compilation-filter - :sentinel sentinel - :file-handler t))) + (let* ((c `(,rustfmt + ,@(split-string rustic-rustfmt-args) + ,@command "--" ,@files)) + (proc (rustic-make-process :name rustic-format-process-name + :buffer err-buf + :command (remove "" c) + :filter #'rustic-compilation-filter + :sentinel sentinel + :file-handler t))) + (with-current-buffer err-buf (setq next-error-last-buffer buffer) (when string (process-put proc 'command-buf cur-buf)