SWI-Prolog 5.6.53 Reference Manual: Section 2.5

## 2.5 GNU Emacs Interface

The default Prolog mode for GNU-Emacs can be activated by adding the following rules to your Emacs initialisation file:

    (setq auto-mode-alist
          (append
           '(("\\.pl" . prolog-mode))
           auto-mode-alist))
    (setq prolog-program-name "pl")
    (setq prolog-consult-string "[user].\n")
    ;If you want this.  Indentation is either poor or I don't use
    ;it as intended.
    ;(setq prolog-indent-width 8)

Unfortunately the default Prolog mode of GNU-Emacs is not very good. An alternative `prolog.el` file for GNU-Emacs 20 is available from http://www.freesoft.cz/~pdm/software/emacs/prolog-mode/ and for GNU-Emacs 19 from http://w1.858.telia.com/~u85810764/Prolog-mode/index.html