4

Just out of curiosity, why isn't emacs-lisp-mode derived from lisp-mode? Instead, both are derived from prog-mode.

It seems to me that there is a natural hierarchical relationship that should exist. Is the current situation simply a case of historical accident, or is there a good reason that emacs-lisp-mode should not derived from lisp-mode?

6

Because lisp-mode is actually meant to be the major mode for Common-Lisp. Emacs-Lisp and Common-Lisp are closely related but neither is a superset of the other, so they should both derive from the same parent mode but not from each-other.

We could probably introduce a lispish-mode as a parent of all major modes for Lisp-like languages, but I'm not completely sure how much they could/should share (should it accomodate Scheme as well? Clojure?)

  • Interesting. It does make it difficult to make some Lisp-specific modifications, however. For example, if I want to use prettify-symbols-mode for all Lisps to display lambda as the single Greek letter, what hook should I add this functionality to? If I add it to prog-mode-hook, it will affect non-Lisp languages too (which is not a big deal). – Tianxiang Xiong Dec 7 '15 at 6:05
  • 1
    There's nothing wrong with adding it to both emacs-lisp-mode-hook and lisp-mode-hook. – phils Dec 7 '15 at 6:18
  • @TianxiangXiong: I'd say using prettify-symbols-mode to display lambda as an actual lambda makes sense for languages that use lambda, this includes several but not all lisps (for example Clojure and Arc don't use lambda) and also includes some other languages, such as Python. – Omar Dec 8 '15 at 20:48
  • Note that prettify-symbols-mode is a global minor mode. So it's something that gets enabled and applies to all modes at the same time. Which symbols get prettified is specified independently by each major mode. – Stefan Dec 9 '15 at 3:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.