5

I installed clang-format package from the MELPA repository.

I added it to the load-path in my init file.

Whenever I try to use it it says:

Searching for program: No such file or directory, clang-format

I would assume this is because I don't have some kind of style file. Is this correct?

If so, how would I create such a file?

1 Answer 1

6

load_path is used for emacs lisp libraries, what you're looking for is exec-path:

(setq exec-path (append exec-path '("/path/to/clang-format")))

Or you can customize clang-format-executable

3
  • 1
    The problem was that I didn't have clang-format installed on my machine. I thought it was an emacs-only package. Your answer gave me the hint. sudo apt install clang-format
    – Rtsne42
    Commented Jan 13, 2017 at 18:33
  • So to choose a particular version of clang-format: (setq clang-format-executable "/usr/bin/clang-format-5.0") Commented Sep 3, 2018 at 11:54
  • That's right. You can try it yourself. Commented Sep 3, 2018 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.