GNU Emacs 23.2.1
Fedora xfce 14我开始进入Prolog,并且我想使用我的emacs作为在Prolog中编程的IDE。
目前我对c/c++使用emacs。但是不确定如何开始使用Prolog。我知道emacs有一个用于在emacs中编程的内置库。然而,我研究发现它的特征较少,即没有语法突出显示,缩进等。
所以我下载了emacs prackage Prolog.el。我已经使用M-X Load-library加载了这个库。
然而,我不确定在那之后该做什么。如何编译我的prolog文件?在emacs IDE的菜单中,Prolog没有任何内容。
我还需要下载一些Prolog的解释器或编译器吗?是否有用于编译的emacs命令?在编译c代码时,我通常在emacs中使用make。
我做了一个yum搜索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菜单选项。
因此,我编写了一些prolog代码,并从prolog菜单中选择Run interactive prolog session
我打开了第二个空白缓冲区,显示为(Inferior Prolog:run Shell-Compile)
然而,我不确定在这个阶段我需要做什么。如何编译和运行prolog文件?
非常感谢您的进一步支持。
发布于 2011-03-13 16:54:11
您需要一个Prolog环境,例如SWI-Prolog、GNU-Prolog或YAP。我认为SWI是非常常用的,但我不知道它是否比其他的更好。您不需要编译Prolog文件来运行它们- Prolog可以作为解释器工作(在某些情况下,交互式编译器)。要将文件加载到Prolog环境中,您需要查阅该文件。当处于Prolog模式时,emacs可以使用C-c C-f执行此操作。您也可以直接从Prolog shell consult(File)输入。
发布于 2011-03-25 05:45:04
另一个很好的emacs模式的替代方案是Ciao。
发布于 2011-03-13 19:42:17
更完整的prolog模式可以在这里找到:Prolog mode for (X)Emacs如果您在.el文件中搜索字符串prolog- mode -keybindings,或者在prolog模式下执行C-h,您可以看到可用的内容。
如果您安装了pl.x86_64:您还可以使用SWI Prolog内置编辑器PceEmacs,请参阅此处:The SWI-Prolog builtin editor: PceEmacs SWI Prolog非常完整,除了一个图形调试器The graphical tracer和它自己的图形用户界面系统The XPCE GUI system for Prolog以及许多库之外,还包括一个基于文本的调试器。这是一个很好的探索前言。如果您想使用带有emacs的SWI Prolog,下面是设置Using SWI-Prolog with GNU-Emacs
https://stackoverflow.com/questions/5288024
复制相似问题