1

For some reason certain executables are not being found when I add them to the load patch but others are, while n the same directory. For example I got clang-format under usr/local/bin and I have

(setq exec-path (append exec-path '("/usr/local/bin")))
(require 'clang-format)

This in my init.el. It works just fine.

Now I installed hindent for Haskell (https://github.com/commercialhaskell/hindent) and put the executable hindent also under usr/local/bin.

In the same fashion I put

(setq exec-path (append exec-path '("/usr/local/bin")))
(require 'hindent)

in my init.el.

However when I load Emacs (GUI and shell) I will get "cannot open load file: No such file or directory, hindent".

Has this to do with emacs? I don't see why it would produce an error for the one file but not the other.

Drew
  • 75,699
  • 9
  • 109
  • 225
lo tolmencre
  • 169
  • 6
  • 4
    `exec-path` is where subprocesses find executable files. so your emacs should be able to find the executable. However, `require` is looking not for the executable, but for `hindent.el` (or the compiled file) which is the emacs lisp interface to `hindent`. You have to modify `load-path` for that (or put `hindent.el` in one of the directories that is in the load path already). – NickD Dec 26 '17 at 01:26
  • @Nick: Please post that as an answer. OP: Please consider accepting it as the answer (unless you get another answer that you find more appropriate). – Drew Dec 26 '17 at 17:20

1 Answers1

1

exec-path is where subprocesses find executable files. so your emacs should be able to find the executable. However, require is looking not for the executable, but for hindent.el (or the coresponding compiled file hindent.elc) which is the emacs lisp interface to hindent. You have to modify load-path for that (or put hindent.el in one of the directories that is in the load path already).

NickD
  • 27,023
  • 3
  • 23
  • 42