I'm trying to setup emacs to use the clang-format
package. I have installed the clang-format
package from MELPA and also have clang-format-10
(apt install
only installs version 6 on Ubuntu) installed on my local machine. I also have the following lines in ~/.emacs
:
(require 'clang-format)
(setq clang-format-style "file")
(setq exec-path (append exec-path '("/usr/bin/clang-format-10")))
I added the last last line because M-x clang-format-region
throws the error:
Searching for program: No file or directory, clang-format
However, the clang-format
package appears to still be looking for a clang-format
binary without the version suffix. Also, it's worth noting I made an alias in my ~/.bashrc
so clang-format
points to clang-format-10
, however that doesn't help me in emacs.