ediprolog icon indicating copy to clipboard operation
ediprolog copied to clipboard

Make SWI work on Windows again.

Open chansey97 opened this issue 2 years ago • 1 comments

Hi, Markus

Thanks you for this remarkable work.

I found that the current ediprolog doesn't work with swi-prolog 8.4.1 on Windows, and @htzh's pull request doesn't work for me. So I had to make some minor changes:

  1. In some.pl buffer, M-x ediprolog-dwim blocks Emacs, and *ediprolog-history* prints No prompt found. This patch fixed the issue by setting process-environment explicitly. It might be related to https://github.com/triska/ediprolog/issues/3 and https://github.com/SWI-Prolog/swipl/blob/d715454d15f6a24c0ffddf6fc157a82ac5be9383/src/pl-init.c#L432.

  2. In some.pl buffer, placing cursor at ?- member(X, [a,b,c])., M-x ediprolog-dwim, the ediprolog can return the first solution, but when pressing ; Emacs blocks again. This because the `ediprolog-send-string need ";\n" instead of just ";" on windows. It might be related to https://github.com/triska/ediprolog/pull/1.

  3. Missing ";" in the original buffer for each solution. So add ediprolog-insert-at-marker.

PS. I haven't tested on other platforms, but at least it can work on windows 7 now.

I can create a pull request, if you think it is OK.

chansey97 avatar Dec 17 '21 13:12 chansey97

Thank you a lot for looking into this! Yes, please do file a pull request so that the code is at least available!

The dream is still to develop a portable toplevel (as a Prolog file that ships with ediprolog, see #2) that runs the same in all conforming Prolog systems. This would make supporting several Prolog systems much easier. I would like to keep the code of ediprolog as simple as possible, and will likely merge changes only if they are relevant for Scryer Prolog too. Still, it would be nice to see which changes you propose, and whether they can be simplified etc. Thank you a lot!

triska avatar Dec 17 '21 17:12 triska