Write new-buffer to new-fname (#9)

* apheleia.el: (apheleia--create-rcs-patch): Write to new-fname from
new-buffer instead of writing from a temp buffer
This commit is contained in:
Kevin Foley 2020-02-09 16:05:32 -05:00 committed by GitHub
parent 179219e619
commit 76f0d946e7

View file

@ -357,9 +357,9 @@ as its sole argument."
(with-current-buffer new-buffer
(and (not (buffer-modified-p)) buffer-file-name))))
(unless (or old-fname new-fname)
(with-temp-buffer
(apheleia--write-file-silently (make-temp-file "apheleia"))
(setq new-fname buffer-file-name)))
(with-current-buffer new-buffer
(setq new-fname (make-temp-file "apheleia"))
(apheleia--write-file-silently new-fname)))
(with-current-buffer (get-buffer-create " *apheleia-patch*")
(erase-buffer)
(apheleia--make-process