                  (ocamlformat--process-errors
                    (buffer-file-name) bufferfile errorfile errbuf)))
              (message "Could not apply ocamlformat"))))
-     (kill-buffer patchbuf)
      (delete-file errorfile)
      (delete-file bufferfile)
      (delete-file outputfile)))

                (get-buffer-create "*compilation*"))
              ((eq ocamlformat-show-errors 'echo)
                (get-buffer-create "*OCamlFormat stderr*"))))
          (patchbuf (get-buffer-create "*OCamlFormat patch*"))
          (coding-system-for-read 'utf-8)
          (coding-system-for-write 'utf-8)
          (margin-args

                       "--name" buffer-file-name
                       "--output" outputfile bufferfile))))
             (progn
               (if ocamlformat--support-replace-buffer-contents
		   (replace-buffer-contents (find-file-noselect outputfile))
		 (ocamlformat--patch-buffer outputfile))
               (message "Applied ocamlformat"))
             (if errbuf
               (progn
