triska / the-power-of-prolog

Introduction to modern Prolog
https://www.metalevel.at/prolog
1.23k stars 76 forks source link

How to set executable path for a package on a configuration file on Emacs? #22

Closed yuis-ice closed 4 years ago

yuis-ice commented 4 years ago

I want to use "ediprolog" package on Emacs as the book mentioned in https://www.metalevel.at/ediprolog/

He says:

The two most important configuration options are: ediprolog-system, either scryer (default) or swi ediprolog-program, the path of the Prolog executable.

So I tried C-X , customize-group , ediprolog and checked the configuration file. The files looks like this:

https://yuis.xsrv.jp/images/ss/ShareX_ScreenShot_8dca08ae-5b43-4c64-8a32-c2b0c318b4c4.png

To be honest I have no idea how, where can I edit to add the prolog executable path ~/.cargo/bin/scryer-prolog. In addition, Emacs says You can't edit this part of the Custom buffer when I tried to type something on the file.

And as I can expected, when I run ediprolog-dwim, "view-echo" says ediprolog-run-prolog: No prompt from: scryer-prolog, probably because I don't set the path on a configuration file.

I'm noob to Emacs and the package also, sorry about that, but I'm really struggling to achieve this step. Your comments must be really helpful for me. Thanks.

triska commented 4 years ago

Everywhere it says "Show Value", you can move the cursor there and press RET to show and set the value.

To see the other options, you have to scroll further in the text, using for instance Ctrl-v. For example, ediprolog-system comes after the options you show on this screenshot.

Also, a graphical interface for Emacs may be more usable for you, see for example the emacs-lucid package on Debian and its derivatives.

I hope this helps! Please keep me posted.

yuis-ice commented 4 years ago

didn't notice that, really helped me, thanks @triska . I'll check GUI one later , thanks for recommendation.

solved the issue, however, I have a another issue, when I type F10 hotkey on a prolog line %?- member(X, [a,b,c]). , I get error(existence_error(procedure,member/2),member/2) error, but not %@ X = a; stuff. I'm not sure this is a bug or my misconfiguration. can I open a new issue for that?

triska commented 4 years ago

Scryer Prolog aims to strictly conform to the Prolog ISO standard, so it provides almost exclusively standard predicates by default. For instance, to use member/2, you must first import the predicate from the lists library.

I recommend to configure Scryer Prolog so that a few often needed predicates are always readily available. You can do this by importing the required modules in the ~/.scryerrc configuration file. The Scryer Prolog documentation contains a configuration suggestion:

https://github.com/mthom/scryer-prolog#configuration-file

I hope this helps, and please do file issues if you have any further questions or suggestions, thank you a lot!

yuis-ice commented 4 years ago

yes, helped me a lot! sorry for bothering you but yes I do when I got a issue. thanks @triska .