|
|
||||
Prolog mode for (X)EmacsSo the Prolog mode that comes with Emacs sucks. Here is then a better alternative, with all the features you would expect, including syntax highlighting, auto indent, and full interaction with an inferior Prolog process. This mode supports in principle any Prolog system, though I am primarily maintaining it with SWI Prolog in mind. It also has some special tweaks for GNU Prolog (starting from version 1.4) and SICStus Prolog, and explicitly supports Prolog's close relatives Eclipse and Mercury. This page is also available in Bulgarian (maintained by a third party). Downloads
InstallationIn a nutshell, place the downloaded file where Emacs can see it, and insert into your ~/.emacs or ~/.xemacs/init.el the following lines:
(autoload 'run-prolog "prolog" "Start a Prolog sub-process." t)
(autoload 'prolog-mode "prolog" "Major mode for editing Prolog programs." t)
(autoload 'mercury-mode "prolog" "Major mode for editing Mercury programs." t)
(setq prolog-system 'swi)
(setq auto-mode-alist (append '(("\\.pl$" . prolog-mode)
("\\.m$" . mercury-mode))
auto-mode-alist))
See the comments at the beginning of the source file for the gory details, and this installation guide for an even more detailed explanation. Note that the default behaviour of prolog-insert-predicate-template has changed in version 1.15. The new behaviour is to just insert the predicate name followed by a parenthesis (as opposed to the old behaviour of inserting the predicate name, matching parentheses, and enough commata to separate all the arguments). Indeed, it seems more productive to just type those commata and closing parenthesis. If the old behaviour is desired, set prolog-electric-dot-full-predicate-template (group "Prolog Keyboard") to non-nil. Note that two new customizable variables have been added in version 1.9:
Further note that some more customizable variables have been added (and might be added in future versions), please check the changelog provided at the beginning of the source file. |
||||

