GNU Emacs 23.2.1
Fedora xfce 14
我开始接触 Prolog,我想使用我的 emacs 作为在 Prolog 中编程的 IDE。
目前我将 emacs 用于 c/c++。但不确定如何开始使用 Prolog。我知道 emacs 有一个用于在 emacs 中编程的内置库。然而,我研究并发现它的功能较少,即没有语法高亮、缩进等。
所以我下载了emacs prackage Prolog.el。我已经使用M-X Load-library
.
但是,我不确定在那之后该怎么做。如何编译我的序言文件?在 emacs IDE 的菜单中,Prolog 没有任何内容。
我是否还需要为 Prolog 下载一些解释器或编译器?是否有用于编译的 emacs 命令?我通常在编译 c 代码时在 emacs 中使用 make。
我做了一个 yum search prolog 并得到了这些结果,所以有了所有这些选择,我需要哪一个?:
gprolog.x86_64 : GNU Prolog is a free Prolog compiler
pl.x86_64 : SWI-Prolog - Edinburgh compatible Prolog compiler
pl-static.x86_64 : Static library for SWI Prolog
ppl-gprolog.x86_64 : The GNU Prolog interface of the Parma Polyhedra Library
ppl-gprolog-static.x86_64 : The static archive for the GNU Prolog interface of the Parma Polyhedra Library
ppl-swiprolog.x86_64 : The SWI-Prolog interface of the Parma Polyhedra Library
ppl-swiprolog-static.x86_64 : The static archive for the SWI-Prolog interface of the Parma Polyhedra Library
ppl-yap.x86_64 : The YAP Prolog interface of the Parma Polyhedra Library
yap.i686 : High-performance Prolog Compiler
yap.x86_64 : High-performance Prolog Compiler
非常感谢您的任何建议,
================== 编辑=====================
我已经安装了以下pl.x86_64
我已经下载了 prolog.el 并将其放在以下目录中:
~/.emacs.d/site-lisp/prolog/prolog.el
我已经使用以下配置了我的emacs:
;;; Prolog mode
(setq load-path (cons "~/.emacs.d/site-lisp/prolog/prolog.el" load-path))
(autoload 'run-prolog "prolog" "Start a Prolog sub-process." t)
(autoload 'prolog-mode "prolog" "Major mode for editing prolog programs." t)
(setq prolog-system 'swi) ; prolog-system below for possible values
(setq auto-mode-alist (append '(("\\.pl$" . prolog-mode))
auto-mode-alist))
因此,当我将文件另存为 *.pl 时,我会看到 prolog 菜单选项。
所以我写了一些序言代码,然后从序言菜单中选择Run interactive prolog session
我打开了第二个空白缓冲区,上面写着(Inferior Prolog:run Shell-Compile)
但是,我不确定在这个阶段我需要做什么。如何编译和运行 prolog 文件?
非常感谢您的进一步支持。