diff options
| author | Radon Rosborough <radon@intuitiveexplanations.com> | 2022-10-14 17:41:48 -0700 |
|---|---|---|
| committer | Radon Rosborough <radon@intuitiveexplanations.com> | 2022-10-14 17:41:48 -0700 |
| commit | 495650ca9d75dbf5ad602ed94df1f23168688a28 (patch) | |
| tree | a2dd143ac23710bd4e693fd8ed77062d167c12f8 | |
| parent | cde18fe48d826bab60c41cef8b89e8d8c0846d77 (diff) | |
| parent | aae79b7b2a1a7bc905b005ec3f43feb56918b93d (diff) | |
Merge branch 'main' into rr-unmess-ruby
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | apheleia.el | 14 |
2 files changed, 10 insertions, 7 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index fca7720..d11bc9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,8 @@ The format is based on [Keep a Changelog]. * clang-format doesn't handle filenames correctly by default. Support for guessing the flags from first the file name then the major mode in the case of a temporary buffer was added in [#128] +* Fix handling of formatters using `inplace` in some circumstances + ([#132]). ### Formatters * [elm-format](https://github.com/avh4/elm-format) for Elm ([#100]). @@ -64,6 +66,7 @@ The format is based on [Keep a Changelog]. [#126]: https://github.com/radian-software/apheleia/pull/126 [#127]: https://github.com/radian-software/apheleia/pull/127 [#128]: https://github.com/radian-software/apheleia/pull/128 +[#132]: https://github.com/radian-software/apheleia/pull/132 ## 3.0 (released 2022-06-01) ### Breaking changes diff --git a/apheleia.el b/apheleia.el index 16ae04b..39e4e76 100644 --- a/apheleia.el +++ b/apheleia.el @@ -803,11 +803,11 @@ machine from the machine file is available on")) (let ((input-fname (apheleia--strip-remote input-fname))) (setq command (mapcar (lambda (arg) (if (memq arg '(input inplace)) - input-fname + (progn + (setq output-fname input-fname) + input-fname) arg)) - command))) - (when (memq 'inplace command) - (setq output-fname input-fname))) + command)))) (when (memq 'output command) (setq output-fname (apheleia--make-temp-file run-on-remote "apheleia")) (let ((output-fname (apheleia--strip-remote output-fname))) @@ -871,9 +871,9 @@ purposes." (lambda (stdout) (when output-fname ;; Load output-fname contents into the stdout buffer. - (erase-buffer) - (insert-file-contents-literally output-fname)) - + (with-current-buffer stdout + (erase-buffer) + (insert-file-contents-literally output-fname))) (funcall callback stdout)) :ensure (lambda () |
