Subject: bug#49278: 28.0.50; Lisp Mode is for Common Lisp

From: João Távora <[email-masked]>
Date: Tue, 29 Jun 2021 19:06:19 +0100

Hi,

It's been the status quo for a long time now that Lisp Mode is the Emacs
major mode for editing Common Lisp programs.  The SLIME and SLY packages
are popular amongst CL programmers and have relied on this fact for many
years (SLIME in I think has been the tool of choice for Emacs+CL for
more than 15 years).

In addition, there are many references to "Common Lisp" in lisp-mode.el.

In addition, non-CL-lisps have also historically used their own major
modes derived from prog-mode.  Examples are Emacs lisp mode, Scheme mode
and Clojure mode.

In addition, there is in Emacs 27.1 a new lisp-data-mode.  That is
useful for defining using define-derived-mode to make Lisp-like major
modes derived from commonly found Lisp-style functionality such as
parenthesis-matching syntax tables and such.

However, the docstring of lisp-mode, the function, still states that it
is used for "Lisps other than GNU Emacs Lisp".  Likely this docstring
was written when Common Lisp was still young and intended to group its
closely-related Lisp brethren (MacLisp, Franz Lisp, etc) in mind.

Those variants are now gone, we should update lisp-mode.el's docstring
to reflect the state of things, since a fraction of people seem to be
misusing lisp-mode to derive new major modes for new niche Lisps, where
they should be using lisp-data-mode (perhaps they are not aware of it).

See also:

  https://gitlab.com/technomancy/fennel-mode/-/issues/11
  https://github.com/joaotavora/sly/issues/339
  https://emacs.stackexchange.com/questions/18646/why-isnt-emacs-lisp-mode-derived-from-lisp-mode/18652#18652

João

To fix this, I suggest this documentation patch.

diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index 8de93867ba..7d655449c5 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -1764,10 +1764,10 @@ External Lisp
 @cindex mode, Lisp
 @cindex Common Lisp
 
-  Lisp mode is the major mode for editing programs written in
-general-purpose Lisp dialects, such as Common Lisp.  Its mode command
-is @kbd{M-x lisp-mode}.  Emacs uses Lisp mode automatically for files
-whose names end in @file{.l}, @file{.lsp}, or @file{.lisp}.
+  Lisp mode is the major mode for editing programs written in Common
+Lisp or its ancestor dialects.  Its mode command is @kbd{M-x
+lisp-mode}.  Emacs uses Lisp mode automatically for files whose names
+end in @file{.l}, @file{.lsp}, or @file{.lisp}.
 
 @findex run-lisp
 @vindex inferior-lisp-program
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 59325d647d..99bf1a98c2 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -765,7 +765,7 @@ lisp-mode-menu
      :help "Run an inferior Lisp process, input and output via buffer `*inferior-lisp*'"]))
 
 (define-derived-mode lisp-mode lisp-data-mode "Lisp"
-  "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp.
+  "Major mode for editing Common Lisp code.
 Commands:
 Delete converts tabs to spaces as it moves back.
 Blank lines separate paragraphs.  Semicolons start comments.