Search code examples
emacsprologswi-prologemacs24

Emacs can't load swi-prolog with default prolog-mode?


My Gnu Emacs 24.4 on Win 8 can't seem to work with it's default prolog mode. I have the latest version of SWI Prolog.

When I load Gnu Emacs and type in Mx prolog-mode, the syntax gets highlighted. However, I am not able to compile the rules, or do anything with them. When I try to run prolog from inside Emacs using Cc RET, it says "Searching for program: no such file or directory, prolog".


Solution

  • The error message tells you that Emacs couldn't find any executable with name prolog in load-path. So presumably the problem is that you haven't put your installation of SWI-Prolog into your $PATH.

    An alternative to setting $PATH in your environment (or load-path in your ~/.emacs) is to set prolog-program-name in your ~/.emacs.