So, I'm trying to use ack from emacs. I've tried setting the path correctly in the following manner

(setenv "PATH"
  (concat "/home/davor/bin/bin:"
          (getenv "PATH")))

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

This gives me the following path

ELISP> exec-path 
  ("/usr/bin" "/bin" "/usr/sbin" "/sbin" 
  "/Applications/Emacs.app/Contents/MacOS/bin" "~/bin/bin" 

When I try to run ack, I get this error

zsh:1: command not found: ack

It should be able to find it, though.

➜  ~ ls -la /usr/local/bin/|grep ack
lrwxr-xr-x    1 davorb  admin    26 Aug 20 11:15 ack -> ../Cellar/ack/2.24/bin/ack

What am I missing?

  • you should be adding /usr/local/Cellar/ack/2.24/bin/ to PATH variable.. – junnu Oct 19 '18 at 10:43
  • @junnu isn't it enough with the symlink that's in place? – davorb Oct 19 '18 at 13:05
  • 1
    yeah it should be enough.. could you try adding /usr/local/bin (where symlink is located) or /usr/local/Cellar/ack/2.24/bin/ (where binary is located) to PATH variable and check once.. you added the symlink path to exec-path but not to PATH variable. you could confirm whether the path is set correctly or not with echo $PATH – junnu Oct 19 '18 at 17:03
  • 1
    You are starting zsh (maybe via term) in emacs to run ack? In that case you have to add /usr/local/bin via (setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin")). – Tobias Oct 19 '18 at 17:05

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.