I'd like to use the PceEmacs editor but whenever I use the command emacs.
, I'm met with the error code
ERROR: Undefined procedure: emacs/0 (DWIM could not correct goal)
. The normal built in commands seem to work as normal so I don't know if I'm just using the emacs command wrong.

- 10,264
- 13
- 101
- 209

- 23
- 3
-
1This might [help](https://swi-prolog.discourse.group/search?q=pceemacs) – Guy Coder Jun 23 '19 at 22:07
-
2I'm voting to close this question as off-topic because this is really a request for technical support with SWI-Prolog and would be better addressed to the SWI-Prolog mailing list. There is no code here for us to help you debug, so it isn't really on-topic for Stack Overflow. – Daniel Lyons Jun 24 '19 at 05:06
2 Answers
You have probably not installed everything. You need to tell us what operating system you are using, how you installed SWI-Prolog, and stuff like that.
For example, in an installation without PCE, you won't have PceEmacs. On a machine on which I purposefully don't have PCE, I see the exact same thing as you do:
$ swipl
Welcome to SWI-Prolog (threaded, 64 bits, version 8.1.8-43-gb0168ea4a-DIRTY)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit http://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
?- emacs.
ERROR: Unknown procedure: emacs/0 (DWIM could not correct goal)
This is because I have, in my build script:
cmake -G Ninja -DSWIPL_PACKAGES_X=OFF ...

- 1,316
- 6
- 12
-
1OK, I built SWI-Prolog through homebrew on Mac and I believed that it had installed PCE with it. Sorry, my mistake. – Nathanael Payen Jun 24 '19 at 22:59
-
Did you stick with the homebrew version or resorted to a custom install for PCE? – Erik Kaplun Oct 05 '19 at 20:16
-
@ErikAllik I am on a Linux which is not Ubuntu so homebrew is not at all relevant for me. I just build SWI-Prolog from source, which on Linux is best option if you are not on Ubuntu. For Ubuntu there is an official PPA. But this is for developing, for deployment there are other better options. I hope this information was somehow helpful. – User9213 Oct 07 '19 at 06:54
I ran into this same problem and found that the issue was that I had not built SWI-Prolog with support for library(pce)
.
It turns out that I was missing a lot of libraries. You can check which ones you are missing by running check_installation.
from swipl.
Unfortunately I know nothing about Mac OS but the solution that worked for me with Linux was to go through the lists (below) of packages required for a complete install and make sure each one is installed. After you know each one is installed go ahead and rebuild SWI-Prolog.

- 527
- 2
- 15