Anyone using The Prolog Development Tool - A Prolog IDE for Eclipse?

Found this old SWI-Prolog nabble post which notes

Therefore, the next PDT release will contain a graphical wizard that walks you through all the places with undeclared / wrongly declared metapredicates and lets you

  • insert the missing declarations automatically
  • tell the system not to complain again about a particular metapredicate that you do not want to declare.

PDT - The Prolog Development Tool - A Prolog IDE for Eclipse

The reason for the question is that trying to get Eclipse and then PDT to work could take some time and not even work, so want to make sure it is worth the effort before stating. More importantly want to know if it is of value in helping to identify where meta_predicate/1 is needed and/or how to fix them.

GitHub repository (PDT)

Personal Notes

A search of the GitHub code for meta is useful.

I have tried in the past to install Eclipse IDE for prolog, with a plugin from a German university

I have tried for not too long time, and I coudnt get it fully working

there is also a Windows IDE for SWI prolog created by GerHard Rohner, which works nice. I can provide you that one if you want, by uploading the files

for some time I was using Sublime editor with prolog plugin, and then I thought that the built in Emacs was better, the only thing is that it doesnt have the find in files option,

now I sometimes use 2 editors at the same time, Emacs and sublime text for the find in files function


It is not that I want use PDT as an IDE, I want it because it has code to analyze and help with meta predicates.

I did find the that the meta predicate analysis code is in Prolog and available in the GitHub repository so I might just bypass the entire IDE and try getting the code to run directly from the top level.

Maybe that should be added. I’m old school Unix, so I typically I have plenty of terminals open and run

git grep -n pattern ...

That shows me the matches with file:line prefixed. Then I use a little script edit, which is available from and copy/paste this file and line to run

edit file:line

Emacs and PceEmacs have M-x grep, but that requires an installed grep executable and doesn’t seem to work right now :frowning:

One issue is what to search. I can see

  • All files in the current directory (recursive or not)
  • All files loaded into the editor (search buffers)
  • All files loaded into Prolog
  • All files of the current git repo.

Most of this stuff is done by the built-in editor based on library(xref). You can also to code analysis on the loaded code, mainly using library(prolog_codewalk). The latter uses the same meta-predicate analysis as ProDT.

if you have indeed these commandline tools the you can jump from the search results to the mentioned line in the file with the editor.

recently I found that it was possible to let Emacs behave windows alike for example for Ctrl-c and Ctrl-v, so that on linux you can use Emacs with these commands.

it is not a problem to have 2 editors open, 1 Emacs and another for find files function, but would ofcourse be nice

autocomplete is in my opinion almost never a plus, then copying the whole
predicate declaration form the manual to the current editor is a lot better

jumping to predicates declarations from where they are used can be nice, I thought that was already made possible in the current emacs.

an ideal IDE could save a lot of work because many things can be automised.

when writing source code I use Alt-tab and Ctrl -Tab to be able to switch back and forth between my current files, but still there is a danger that i get lost because it shows me the wrong files in the wrong positions

Pushed some fixes to re-enable the M-x grep and M-x git-grep commands. At least these now work again on Linux and MacOS. Didn’t test Windows. Probably works if you have grep and git command in %PATH%.

Note that M-x grep Means meta-X followed by grep and return. Meta in Emacs always works as ESC-x (escape followed by x) and typically using Alt-x (Alt together with x) or in MacOS Command-x (Command together with x). M-x commands are completed on TAB. That is all pretty much standard Emacs.

Now you get the output of the command in a buffer. Search through the matches, put the cursor on a line you are interested in and use ^c^e, i.e., Control+c and Control+e to go to the matching line.

This stuff is all terribly old. Notably the PceEmacs process class doesn’t deal with character encoding issues and thus this only works in the ASCII world and probably for the whole ISO-Latin-1 character set if the locale is ISO-Latin-1. Might have a look at the usual locale support someday :frowning: Alternatively, using threads and Prolog rather than xpce to talk to the process might fix this.