7 Editing Prolog code

Sweep includes a dedicated major mode for reading and editing Prolog code—Sweep Prolog mode, or simply sweeprolog-mode.

Command: sweeprolog-mode

Enable the Sweep Prolog major mode for reading and editing SWI-Prolog code in the current buffer.

Variable: sweeprolog-mode-hook

Hook run after entering Sweep Prolog mode. See (emacs)Hooks, for more information about major mode hooks in Emacs.

To activate this mode in a buffer, type M-x sweeprolog-mode RET. To instruct Emacs to always open Prolog files in Sweep Prolog mode, modify the Emacs variable auto-mode-alist accordingly:

(add-to-list 'auto-mode-alist '("\\.plt?\\'"  . sweeprolog-mode))

See (emacs)Choosing Modes, for more information about how Emacs chooses a major mode to use when you visit a file.

To list all of the commands available in a Sweep Prolog mode buffer, type C-h m (describe-mode). When Menu Bar mode is enabled, you can run many of these commands via the Sweep menu. For more information about Menu Bar mode, see (emacs)Menu Bars.