Open JanWielemaker opened 8 years ago
Unfortunately, the default Prolog mode in GNU Emacs right now is bad bad bad. At some point, after the discussion about prolog-mode
was not really going anywhere, Markus seems to have taken responsibility over this mode: http://lists.gnu.org/archive/html/bug-gnu-emacs/2015-10/msg00824.html I hope I'm not misinterpreting his words here.
Anyway, the crappy prolog-mode
will be released as part of GNU Emacs 25.1. There is nothing we can do about that. We can should therefore refer to Bruda's mode + ediprolog as alternatives. It would be even better if Markus or someone else would find the time to improve prolog-mode
in ELPA and in 25.2.
I am maintaining information about Emacs and Prolog at:
https://www.metalevel.at/pceprolog/
@Wouter: Unfortunately the (then) Emacs-maintainer changed his mind and insisted to keep the broken code, even after I agreed to and accepted his own offer to restore the old mode and hand over maintainership to me:
http://lists.gnu.org/archive/html/bug-gnu-emacs/2015-10/msg00988.html
I have reported all major issues I found in Emacs issue 21526; if you are interested in improving Emacs, please add your contribution and view to this report on the Emacs mailing list, in order to convince the new Emacs maintainer that the current behaviour of the Prolog mode that ships with Emacs is unacceptable for Prolog programmers.
As things currently stand, I can only repeat what I say in PceProlog:
There is an excellent Prolog mode for Emacs, maintained by Stefan Bruda.
Recent GNU Emacs versions also ship with a variant of this mode. Unfortunately though, the variant that ships with GNU Emacs contains some modifications that cause severe regressions with indenting and navigation. Therefore, I recommend you use the version that is directly supplied by Stefan until these mistakes are corrected.
My page also links to other programs and snippets that implement Emacs features for editing Prolog code. Thank you for your interest in this, and I hope others find them also useful. ediprolog in particular has saved me countless hours of switching between windows and pasting queries and answers.
@triska Thanks for the update/clarification on this issue. I still have some questions though.
The reason why Stefan Monnier did not gladly agree to your generous proposal of taking over maintainership for prolog-mode
seems to be that he believes prolog-mode
's indentation and navigation should be based on SMIE. For reference: he made this change on 2013-10-25. Is your idea to fix the current implementation using SMIE or would you remove dependency on SMIE altogether?
According to lisp/progmodes/prolog.el
Stefan Bruda is still the maintainer of that mode. In that case, should not he decide where someone / who takes over maintenance of this module? And there's a new general maintainer indeed. Maybe you should pitch your intent on emacs-devel
and see what happens?
I mostly care about the features, and in particular I would like Emacs to ship without regressions in comparison to Stefan Bruda's very good mode. The mode is not perfect, and using SMIE in places may improve some situations, but what is currently in Emacs is, at least in my view, a significant regression in comparison to what even Emacs previously provided (i.e., when Stefan Bruda's original mode was included with little changes). Historically, we had in Emacs:
I have stopped discussing this with the Emacs maintainers because I consider it unlikely that important changes of the current Emacs behaviour will be accepted or implemented, whether using SMIE or not:
http://lists.gnu.org/archive/html/bug-gnu-emacs/2015-10/msg00134.html http://lists.gnu.org/archive/html/bug-gnu-emacs/2015-10/msg00033.html
Stefan Bruda is still the maintainer of the external Prolog mode and he provides it at:
https://bruda.ca/emacs/prolog_mode_for_emacs
I recommend to link directly to Stefan Bruda's mode in the FAQ. Stefan is a very prudent maintainer, and his code has reliably worked for me throughout many years and all Emacs versions I have used.
My personal preference would be for Emacs to simply ship Stefan Bruda's mode, as was also previously the case, and to work with Stefan on a few more ideas I have for the mode. Good luck with convincing the Emacs maintainers. If SMIE could express everything at least equally well and leads to shorter or more elegant (Elisp) code, then I would prefer it; however, as far as I can tell, that is not the case, and in fact the introduction of SMIE in the Prolog mode has made the mode that ships with Emacs unusable for me. Seeing how hard it was to get even simple things fixed (please see the bug report: at some point even SMIE itself had to be extended), I have little hope that more complex things can be implemented with it, although in fairness, I must note that I did not even look further after the lengthy list of regressions I had found after a few minutes of use.
TL;DR: Please make the FAQ link to Stefan Bruda's mode: https://bruda.ca/emacs/prolog_mode_for_emacs
Page http://www.swi-prolog.org/FAQ/GnuEmacs.html should mention both Markus' ediprolog and Stefan Bruda's one. Which version is now default in Emacs?