17.1 Improvements around editing Prolog

Respect font-lock-maximum-decoration

We should take into account the value of font-lock-maximum-decoration while highlighting sweeprolog-mode buffers. This variable conveys the user’s preferred degree of highlighting. A possible approach would be changing sweeprolog-analyze-fragment-to-faces such that each color fragment in the returned list states the minimum decoration level (1, 2 or 3) for which it should apply. sweeprolog-analyze-fragment-font-lock would then compare this target to the value of (font-lock-value-in-major-mode font-lock-maximum-decoration) and decide whether or not to apply the fragment.

Support M-x align

Sweep Prolog mode should integrate with align.el such that M-x align aligns arguments of consecutive predicate calls. Concretely, we need to locally set align-mode-rules-list to a suitable value in sweeprolog-mode.

Support code filling/formatting

Sweep Prolog mode should define a fill-paragraph-function, and perhaps also a normal-auto-fill-function, for code filling that takes into account Prolog-specific conventions.