Is there any way to easily find all the modes that derive from a mode?

The closest I can get is to use M-x apropros and search for -mode$ and manually comb through all defuns with the property derived-mode-parent and peek at them to see if they derive from the mode I am interested in. I suppose I could write a routine to do that quickly, but I'd rather not if I can help it.

  • 1
    I'm pretty sure you'll need to write that code yourself, but I would suggest using mapatoms instead of any kind of apropos call. (And just process anything with a derived-mode-parent property, as you've already determined.) – phils Apr 3 '16 at 21:58
  • You can use derived-mode-p instead of checking derived-mode-parent, but it's about the same thing. The hard part is finding "all modes" to test. A derived mode need not have a name that ends in -mode... – Drew Apr 4 '16 at 4:01
  • Of course, some of those derived modes may not be in your Emacs session yet, or may not be present on your machine (yet) either, so it also depends on how exhaustive you want to be. – Stefan Apr 4 '16 at 13:09

Your Answer

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

Browse other questions tagged or ask your own question.