Description
I've noticed on emacs-devel that Lisp-like modes weren't supposed to derive from lisp-mode
(which is a major mode for Common Lisp), but rather from lisp-data-mode
or directly from prog-mode
. There's also a nice related discussion about this in fennel-mode
's issue tracker (https://gitlab.com/technomancy/fennel-mode/-/issues/11). Here's the most interesting part for us:
If a buffer is in lisp-mode it has CL code in it. There are many references to "Common-Lisp" in lisp-mode.el and this has long been the status-quo If you want to make a Lisp-like language mode, use
lisp-data-mode
and/or a make a major mode that uses the lisp-mode features you're interested in, much like clojure-mode. As with inheritance in general, only inherit from lisp-mode if you can guarantee the "is a" relationship.
And here are the changes done by @andreyorst in fennel-mode
to switch to prog-mode as the parent - https://gitlab.com/technomancy/fennel-mode/-/merge_requests/31 I'm guessing we can do something very similar.
That's kind of related the ancient #270 - I've long felt that our original approach to derive from lisp-mode
created just as many problems as it solved.