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?

Rtsne42
  • 489
  • 5
  • 13

1 Answers1

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

Felipe Lema
  • 737
  • 3
  • 11
  • 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 Jan 13 '17 at 18:33
  • So to choose a particular version of `clang-format: (setq clang-format-executable "/usr/bin/clang-format-5.0")` – Fred Schoen Sep 03 '18 at 11:54
  • That's right. You can try it yourself. – Felipe Lema Sep 03 '18 at 12:21