I have installed GNU Go 3.8 and am trying to use it in emacs. I have downloaded gnugo.el from here and have copied gnugo-big-xmps.el from my gnugo-3.8/interface directory, putting both in my .emacs.d. I have the following two lines in my init.el:

(autoload 'gnugo "gnugo" "GNU GO" t)
(autoload 'gnugo-xpms "gnugo-big-xpms" "GNU GO" t)

I can use M-x gnugo, and am prompted for GNU Go options:, but when I press RET, I get the error Searching for program: no such file or directory, gnugo. I don't think that this is a problem with my installation of GNU Go, since it works fine from the command line. Can anyone help?

I am using Emacs 24.5.1 on OS X El Capitan, 10.11.3.

  • Check the value of M-h v exec-path, and see if gnugo is in one of the locations listed in there. If it's not, simply add the directory where gnugo lives to this list. (eg. (push (shell-command-to-string "dirname $(which gnugo)") exec-path).
    – wvxvw
    Mar 19 '16 at 22:23
  • Tried doing this with (setq exec-path (append exec-path '("/usr/local/bin"))) and (setq exec-path (append exec-path '("~/Downloads/gnugo-3.8"))), and now get the error message Cannot open load file: no such file or directory, gnugo before even getting the prompt for GNU Go options: Mar 19 '16 at 23:12
  • Well, this means that the file with the Emacs Lisp code for gnugo isn't on the load-path. I don't quite understand how would the utoload work before, but it seems like you need to put the Emacs Lisp sources for the game somewhere on the load-path (or again, add the directory with the sources to the load-path). It was probably better to keep the gnugo.el where it was and instead add its parent directory to load-path.
    – wvxvw
    Mar 19 '16 at 23:29
  • Added the folder containing gnugo to the load-path, am now getting the original problem. Relevant section in my init.el: (add-to-list 'load-path "~/.emacs.d/gnugo-3.8/interface") (autoload 'gnugo "~/.emacs.d/gnugo-3.8/interface/gnugo.el" "GNU GO" t) (autoload 'gnugo-xpms "~/.emacs.d/gnugo-3.8/interface/gnugo-big-xpms.el" "GNU GO" t) Mar 19 '16 at 23:38
  • Try M-x toggle-debug-on-error and once you get this error, look at the backtrace (the buffer will pop-up showing the list of function calls from the last to the first). RET on a function name in this buffer will open the function's definition, there you'll be able to see what the function was doing when it received the error (i.e. where it was trying to look for gnugo).
    – wvxvw
    Mar 20 '16 at 6:24

The solution was:

  • Add gnugo-3.8/interface to my .emacs.d
  • Add this directory to both the load-path and the exec-path

My problem was that the directory I added to the exec-path contained directories that contained gnugo, rather than containing gnugo directly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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