 
 (defun emr-cc-format-region (start end)
   "Format region (START/END).
-Uses either clang-format, if available, or `indent-region-function'."
+Uses either clang-format, if available, or `emr-c-format-fallback-func'."
   (interactive "rp")
   (if (emr-clang-available?)
       (clang-format-region start end (emr-cc-get-style))
-    (indent-region start end)))
+    (funcall emr-c-format-fallback-func start end)))
 
 (defun emr-cc-format-buffer ()
   "Format region (START/END).
-Uses either clang-format, if available, or `indent-region-function.'"
+Uses either clang-format, if available, or `emr-c-format-fallback-func.'"
   (interactive)
   (if (emr-clang-available?)
       (clang-format-buffer (emr-cc-get-style))
-    (indent-region (point-min) (point-max))))
+    (funcall emr-c-format-fallback-func (point-min) (point-max))))
 
 (defalias 'emr-cc-tidy-includes 'emr-c-tidy-includes)
 

  :title "format buffer"
  :description (if (emr-clang-available?)
                   "with clang"
                 "with indent-region-function")
  :modes '(c-mode c++-mode)
  :predicate 'emr-region-inactive?)


(autoload 'clang-format-buffer "clang-format" ""  t)

(defun emr-clang-available? ()
  "Return whether clang-format is available."
  (and (featurep 'clang-format)
       (executable-find "clang-format")))

(defun emr-cc-get-style ()
  "Return style as a string."
