Skip to content

Commit

Permalink
Make `rustic-format-start-process' work over tramp.
Browse files Browse the repository at this point in the history
`rustic-rustfmt-bin' selects the rustfmt binary to run depending on
whether the current buffer is local (in which case
`rustic-rustfmt-bin' will be used) or remote
(`rustic-rustfmt-bin-remote').

`rustic-format-start-process' invokes `rustic-rustfmt-bin' inside a
`with-current-buffer' form that makes the error buffer current, which
will always seem local, regardless of whether the buffer being
formatted is local or not

This patch invokes `rustic-rustfmt-bin' as one of the let bindings
so that the correct binary will be selected.
  • Loading branch information
sp1ff committed Jul 30, 2023
1 parent 39423d1 commit 54b2a2c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rustic-rustfmt.el
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,15 @@ and it's `cdr' is a list of arguments."
(command (or (plist-get args :command)
(rustic-compute-rustfmt-args)))
(command (if (listp command) command (list command)))
(cur-buf (current-buffer)))
(cur-buf (current-buffer))
(rustfmt (rustic-rustfmt-bin)))
(setq rustic-save-pos (set-marker (make-marker) (point) (current-buffer)))
(rustic-compilation-setup-buffer err-buf dir 'rustic-format-mode t)
(--each files
(unless (file-exists-p it)
(error (format "File %s does not exist." it))))
(with-current-buffer err-buf
(let* ((c `(,(rustic-rustfmt-bin)
(let* ((c `(,rustfmt
,@(split-string rustic-rustfmt-args)
,@command "--" ,@files))
(proc (rustic-make-process :name rustic-format-process-name
Expand Down

0 comments on commit 54b2a2c

Please sign in to comment.