Index: clang-format.el =================================================================== --- clang-format.el +++ clang-format.el @@ -35,9 +35,21 @@ "Format code using clang-format." :group 'tools) +;; Some distros don't provide a real clang-format. A noteable example is on +;; Debian Jessie where clang-format-3.4 and clang-format-3.5 are both available +;; packages, but the work hasn't been done to set up /etc/alternatives to allow +;; aliasing one to be clang-format +;; +;; This is kind of a hack because there could be a potentially large list of +;; clang versions we need to support, but AFAK Debian Jessie is the only major +;; Linux distro that has this idiosyncacy (and I'd imagine it will be fixed by +;; the next the next Debian stable release is out). (defcustom clang-format-executable - (or (executable-find "clang-format") - "clang-format") + (cond + ((executable-find "clang-format") "clang-format") + ((executable-find "clang-format-3.5") "clang-format-3.5") + ((executable-find "clang-format-3.4") "clang-format-3.4")) + "Location of the clang-format executable. A string containing the name or the full path of the executable."