SWI-Prolog / roadmap

Discuss future development
20 stars 3 forks source link

Enhance Prolog modes of common editors #25

Closed triska closed 4 years ago

triska commented 8 years ago

There is an excellent Prolog mode for GNU Emacs and XEmacs, maintained by Stefan Bruda.

It is available from:

https://bruda.ca/emacs/prolog_mode_for_emacs

This mode is incorporated in recent git versions of GNU Emacs, together with modifications that have unfortunately caused severe regressions.

Contributors that are well-versed in both Prolog and Emacs Lisp are encouraged to look into the mode supplied directly by Stefan Bruda, compare it with the version that ships with GNU Emacs, and correct or report all remaining issues.

In addition, the extremely useful behaviour of Stefan Bruda's mode should ideally be implemented also in other editing environments to make Prolog easy to use out of the box with common editors.

To make good use of the automatic indenting mechanisms of Stefan Bruda's prolog.el, I suggest to try the mode with the following settings in your .emacs:

(setq prolog-electric-if-then-else-flag t)

This mimics the nice electric indentation known from SWI-Prolog's own PceEmacs.

On top of this, SWI-Prolog itself could be dynamically queried from within Emacs to help with indentation. This would also take care of operators.

Please contact me if you want to work on this item and have any questions, in particular for contributions to GNU Emacs.

wouterbeek commented 8 years ago

Paulo has a very extensive list of support for Logtalk in various editors: https://github.com/LogtalkDotOrg/logtalk3/tree/master/coding

triska commented 8 years ago

That's a good link, thank you Wouter!

The thrust of this roadmap item is to improve out-of-the-box behaviour in the editors themselves. Using these available definitions is a good starting point for interested contributors to file issues and send patches to the maintainers of these editors.

wouterbeek commented 8 years ago

I want to report an important data point for this issue: (SWI-)Prolog support on GNU Emacs 25 (pre-release) is not very good. In fact it is worse than it used to be in earlier versions of GNU Emacs.

triska commented 8 years ago

I fully agree. I have tried to make the (then) Emacs maintainer fix the regressions he has introduced:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=21526

So far, not much luck. I recommend to use Stefan Bruda's mode instead, and file new issues in Emacs with M-x report-emacs-bug RET so that the Emacs maintainers treat this issue with higher priority.