Extending xpce/emacs

Given that no other editor seems to have SWI-Prolog language integration as complete as PceEmacs, I’d like to better understand how to customize it (to add features I miss from other editors).

In the documentation, this is everything I found:

:- emacs_extend_mode(+ModeName, +Bindings).
	Used to customise built-in modes.  `ModeName' is the mode to extend.
	`Bindings' provides additional bindings.

What workflow do people use to add custom features to PceEmacs? Just read the source and figure it out?

For example, suppose (as an exercise) I wanted to add an auto-complete hotkey. It would read the current buffer for existing words, look at the current word, and offer completions.

How would I start? (Assuming I want to customize my personal experience, not work on the swi source tree directly).

There is no tutorial. You can browse existing methods using the xpce class browser and use the sources of the other modes for inspiration on how to do things.

Note that the sweep mode for GNU emacs provides almost the same level of interaction, better at some places and a little worse and others.

3 Likes