[#60] Get coding-system from stdin conditionally

This commit is contained in:
Radon Rosborough 2021-12-27 12:34:03 -08:00
parent 2e98165137
commit f0309b17bb
2 changed files with 8 additions and 4 deletions

View file

@ -45,6 +45,9 @@ The format is based on [Keep a Changelog].
([#64], [#65]). Previously, when saving a number of files at the
same time, the contents of those buffers could be corrupted by a
race condition.
* In some circumstances the error `wrong-type-argument bufferp nil`
could be reported when running certain formatters under Apheleia.
This has been fixed.
[#24]: https://github.com/raxod502/apheleia/pull/24
[#30]: https://github.com/raxod502/apheleia/issues/30
@ -57,6 +60,7 @@ The format is based on [Keep a Changelog].
[#52]: https://github.com/raxod502/apheleia/issues/52
[#54]: https://github.com/raxod502/apheleia/pull/54
[#55]: https://github.com/raxod502/apheleia/issues/55
[#60]: https://github.com/raxod502/apheleia/issues/60
[#62]: https://github.com/raxod502/apheleia/issues/62
[#64]: https://github.com/raxod502/apheleia/issues/64
[#65]: https://github.com/raxod502/apheleia/pull/65

View file

@ -329,11 +329,11 @@ command succeeds provided that its exit status is 0."
(kill-buffer stdout)
(kill-buffer stderr)))))))
(set-process-sentinel (get-buffer-process stderr) #'ignore)
(when stdin
(set-process-coding-system
apheleia--current-process
nil
(buffer-local-value 'buffer-file-coding-system stdin))
(when stdin
(process-send-string
apheleia--current-process
(with-current-buffer stdin