 buffer as only argument."
   (unless buffer-file-name
     (user-error "clang-include-fixer works only in buffers that visit a file"))
-  (let ((process (if (fboundp 'make-process)
-                     ;; Prefer using ‘make-process’ if available, because
+  (let ((process (if (and (fboundp 'make-process)
+                          ;; ‘make-process’ doesn’t support remote files
+                          ;; (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=28691).
+                          (not (find-file-name-handler default-directory
+                                                       'start-file-process)))
+                     ;; Prefer using ‘make-process’ if possible, because
                      ;; ‘start-process’ doesn’t allow us to separate the
                      ;; standard error from the output.
                      (clang-include-fixer--make-process callback args)

                  :stderr stderr)))

(defun clang-include-fixer--start-process (callback args)
  "Start a new clang-incude-fixer process using `start-process'.
CALLBACK is called after the process finishes successfully; it is
called with a single argument, the buffer where standard output
has been inserted.  ARGS is a list of additional command line

(defalias 'clang-include-fixer--format-message
  (if (fboundp 'format-message) 'format-message 'format))

;; ‘file-local-name’ is new in Emacs 26.1.  Provide a fallback for older
;; versions.
(defalias 'clang-include-fixer--file-local-name
  (if (fboundp 'file-local-name) #'file-local-name
    (lambda (file) (or (file-remote-p file 'localname) file))))

(provide 'clang-include-fixer)
;;; clang-include-fixer.el ends here
